| 1 |
go-sendxmpp(1) -- A tool to send messages to an XMPP contact or MUC. |
| 2 |
==== |
| 3 |
|
| 4 |
## SYNOPSIS |
| 5 |
|
| 6 |
`go-sendxmpp [-cdilntv] [-a value] [--allow-plain] [--anonymous] [--fast-invalidate] [--fast-off] [-f value] [--headline] [--help] [-h value] [-j value] [--legacy-pgp] [-m value] [--muc-password value] [--no-sasl-upgrade] [--oob-file value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [--ox-receive-private-key value] [--ox-transfer-private-key] [-p value] [--raw] [-r value] [--retry-connect value] [--retry-connect-max value] [--scram-mech-pinning value] [--ssdp-off] [-s value] [--suppress-root-warning] [--timeout value] [--tls-version value] [-u value] [--version] [recipients…]` |
| 7 |
|
| 8 |
## DESCRIPTION |
| 9 |
|
| 10 |
A tool to send messages to an XMPP contact or MUC inspired by `sendxmpp`. |
| 11 |
You can either pipe a programs output to `go-sendxmpp`, write in your terminal (put `^D` in a new line to |
| 12 |
finish) or send the input from a file (`-m` or `--message`). |
| 13 |
The account data is expected at `~/.config/go-sendxmpp/config` (preferred), `~/.config/go-sendxmpp/sendxmpprc` |
| 14 |
(deprecated) `~/.sendxmpprc` (for compatibility with the original perl sendxmpp) if no other configuration |
| 15 |
file location is specified with `-f` or `--file`. |
| 16 |
|
| 17 |
## OPTIONS |
| 18 |
|
| 19 |
* `-a`, `--alias`=[<value>]: |
| 20 |
Set alias/nickname for chatrooms. |
| 21 |
|
| 22 |
* `--allow-plain`: |
| 23 |
Allow PLAIN authentication. Note that this setting has no effect if there was a successful |
| 24 |
connection using a SCRAM authentication mechanism before. In that case PLAIN is not allowed |
| 25 |
to prevent downgrades by a man-in-the-middle attack. |
| 26 |
|
| 27 |
* `--anonymous`: |
| 28 |
Use anonymous authentication. Specify the the target server by using the flag `-u` or `--username`. Username is used to specify the server to be able to override the server by using `-j` or `--jserver` in cases where the service (e.g. anon.example.org) is served by another server (e.g. xmpp.example.org) but no SRV records are set up. |
| 29 |
|
| 30 |
* `-c`, `--chatroom`=[<value>]: |
| 31 |
Send message to a chatroom. |
| 32 |
|
| 33 |
* `-d`, `--debug`: |
| 34 |
Show XMPP stanzas. These can include sensitive data. |
| 35 |
|
| 36 |
* `--fast-invalidate`: |
| 37 |
Invalidate XEP-0484: Fast Authentication Streamlining Tokens. The current FAST token will be invalidated and a new one will be requested. If used together with `--fast-off` the FAST token will be invalidated and the stored FAST token deleted. |
| 38 |
|
| 39 |
* `--fast-off`: |
| 40 |
Disable XEP-0484: Fast Authentication Streamlining Tokens. Deletes the stored FAST token when used together with `--fast-invalidate`. |
| 41 |
|
| 42 |
* `-f`, `--file`=[<value>]: |
| 43 |
Set configuration file. (Default: ~/.config/go-sendxmpp/config) |
| 44 |
|
| 45 |
* `--headline`: |
| 46 |
Send message as type headline. |
| 47 |
|
| 48 |
* `--help`: |
| 49 |
Show help. |
| 50 |
|
| 51 |
* `-h`, `--http-upload=`[<value>]: |
| 52 |
Send a file via http-upload. Can be invoked several times to upload multiple files. |
| 53 |
|
| 54 |
* `-i`, `--interactive`: |
| 55 |
Interactive mode (for use with e.g. `tail -f`). |
| 56 |
|
| 57 |
* `-j`, `--jserver`=[<value>]: |
| 58 |
XMPP server address. |
| 59 |
|
| 60 |
* `--legacy-pgp`: |
| 61 |
"Legacy PGP" encryption using the Ox key infrastructure. This means the recipient must have an Ox key published and use the same key for legacy PGP. |
| 62 |
This encryption method is deprecated and will be removed in a future version, please consider switching to |
| 63 |
*OpenPGP for XMPP* (OX). |
| 64 |
The use of legacy PGP is actually discouraged and only provided as a workaround for conversations users. |
| 65 |
If the existing key has no ID in the form of `xmpp:[email protected]`, it can be added by using the tool *sq*: |
| 66 |
|
| 67 |
``` |
| 68 |
$ sq key userid add -u xmpp:[email protected] -Bo newkey.asc oldkey.asc` |
| 69 |
``` |
| 70 |
|
| 71 |
This key (`newkey.asc` in the *sq* example) can than be imported by using `--ox-import-privkey`. |
| 72 |
Please note that this will store the secret key at `~/.local/share/go-sendxmpp/user_at_example_org/oxprivkey`. |
| 73 |
If you don't want to use that account with go-sendxmpp and only imported the key to upload the public key to pubsub you might consider |
| 74 |
deleting the file. |
| 75 |
|
| 76 |
* `-l`, `--listen`: |
| 77 |
Listen for messages and print them to stdout. If JIDs are specified only messages from those contacts |
| 78 |
are shown. If no JIDs are specified or a chat room is joined all received messages will be shown. |
| 79 |
|
| 80 |
* `-m`, `--message`=[<value>]: |
| 81 |
Set file including the message. |
| 82 |
|
| 83 |
* `--muc-password`=[<value>]: |
| 84 |
Password for password protected MUCs. |
| 85 |
|
| 86 |
* `--no-sasl-upgrade`: |
| 87 |
Disable XEP-0480: SASL Upgrade Tasks. |
| 88 |
|
| 89 |
* `-n`, `--no-tls-verify`: |
| 90 |
Skip verification of TLS certificates (not recommended). |
| 91 |
|
| 92 |
* `--oob-file`=[<value>]: |
| 93 |
URL to send a file as out of band data. |
| 94 |
|
| 95 |
* `--ox`: |
| 96 |
Use "OpenPGP for XMPP" encryption (experimental). |
| 97 |
There is no check whether the recipients key is trusted as there is no local keyring used. |
| 98 |
Go-sendxmpp just uses the most recent key that is provided via pubsub and checks that it is not |
| 99 |
expired. As a user facing client a notification would be shown that a new key is available and |
| 100 |
ask the user whether to use the new key or stick to the old one. As go-sendxmpp is usually |
| 101 |
used in scripts it just accepts the new key to prevent the user from missing a new notification |
| 102 |
due to changed keys. |
| 103 |
|
| 104 |
* `--ox-delete-nodes`: |
| 105 |
Delete existing OpenPGP nodes (public key and private key backup) on the server. |
| 106 |
|
| 107 |
* `--ox-genprivkey-rsa`: |
| 108 |
Generate a private OpenPGP key (RSA 4096 bit) for the configured account (via config file or `-u` and `-p`) |
| 109 |
and publish the corresponding public key. |
| 110 |
Go-sendxmpp will save the key in `$XDG_DATA_HOME/go-sendxmpp/oxprivkeys` or |
| 111 |
`$HOME/.local/share/go-sendxmpp/oxprivkeys`. To protect the key a passphrase might be set |
| 112 |
using `--ox-passphrase` while generating the key. |
| 113 |
If there is an existing private key for "OpenPGP for XMPP" created by another client (e.g. profanity) |
| 114 |
it might be imported using `--ox-import-privkey`. |
| 115 |
|
| 116 |
* `--ox-genprivkey-x25519`: |
| 117 |
Generate a private OpenPGP key (X25519) for the configured account (via config file or `-u` and `-p`) |
| 118 |
and publish the corresponding public key. |
| 119 |
Go-sendxmpp will save the key in `$XDG_DATA_HOME/go-sendxmpp/oxprivkeys` or |
| 120 |
`$HOME/.local/share/go-sendxmpp/oxprivkeys`. To protect the key a passphrase might be set |
| 121 |
using `--ox-passphrase` while generating the key. |
| 122 |
If there is an existing private key for "OpenPGP for XMPP" created by another client (e.g. profanity) |
| 123 |
it might be imported using `--ox-import-privkey`. |
| 124 |
|
| 125 |
* `--ox-import-privkey`=[<value>]: |
| 126 |
Import an existing private OpenPGP key. |
| 127 |
|
| 128 |
* `--ox-passphrase`=[<value>]: |
| 129 |
Passphrase for locking and unlocking the private OpenPGP key. |
| 130 |
|
| 131 |
* `--ox-receive-private-key`=[<value>]: |
| 132 |
Import your encrypted private Ox key from the server. Requires the transfer code. |
| 133 |
|
| 134 |
* `--ox-transfer-private-key`: |
| 135 |
Upload your encrypted private Ox key to the server for key transfer. The private key will be encrypted |
| 136 |
by a random generated passphrase. Please make sure to not lose the passphrase as it can not be recovered. |
| 137 |
|
| 138 |
* `-p`, `--password`=[<value>]: |
| 139 |
Password for XMPP account. |
| 140 |
|
| 141 |
* `--raw`: |
| 142 |
Send raw XML. To send raw XML to a contact as normal chat message no contact must be specified. |
| 143 |
To send raw XML to a MUC you have to specify the MUC via `-c` and go-sendxmpp will join the MUC. |
| 144 |
|
| 145 |
* `-r`, `--recipients`=[<value>]: |
| 146 |
Read recipients from file, one JID per line. |
| 147 |
|
| 148 |
* `--retry-connect`=[<value>]: |
| 149 |
Specify a connection retry waiting time in seconds. This specifies the waiting time until go-sendxmpp |
| 150 |
will try to reconnect if connecting fails. This setting only affects the initial connection, it does not |
| 151 |
reconnect after losing the connection. It is also ignored if the connection fails due to an authentication |
| 152 |
error as then it does not make sense to try again using the same credentials. Setting a time of 0 seconds |
| 153 |
disables this functionality. |
| 154 |
(Default: 0) |
| 155 |
|
| 156 |
* `--retry-connect-max`=[<value>]: |
| 157 |
Number of maximum retries to perform for '--retry-connect'. A value of 0 means unlimited retries. |
| 158 |
(Default: 0) |
| 159 |
|
| 160 |
* `--scram-mech-pinning=[<value>]`: |
| 161 |
Enforce the use of a certain SCRAM authentication mechanism. Currently go-sendxmpp supports |
| 162 |
**SCRAM-SHA-1**, **SCRAM-SHA-1-PLUS**, **SCRAM-SHA-256**, **SCRAM-SHA-256-PLUS**, **SCRAM-SHA-512** |
| 163 |
and **SCRAM-SHA-512-PLUS**. You should know what you are doing when using this setting and |
| 164 |
make sure the chosen mechanism is supported by the server. If not set, go-sendxmpp will use XEP-0474 |
| 165 |
to prevent downgrade attacks (needs server support and requires a SCRAM authentication mechanism). |
| 166 |
|
| 167 |
* `--ssdp-off`: |
| 168 |
Disable XEP-0474: SASL SCRAM Downgrade Protection. |
| 169 |
|
| 170 |
* `-s`, `--subject`=[<value>]: |
| 171 |
Set message subject. |
| 172 |
|
| 173 |
* `--suppress-root-warning`: |
| 174 |
Suppress warning when run as root. |
| 175 |
Note that running as root is discouraged although go-sendxmpp tries to drop the root privileges |
| 176 |
before doing network calls. Be aware that **OX**, **legacy PGP** and the pinning to not use **PLAIN** |
| 177 |
authentication after a successful **SCRAM** authentication are disabled as those need file system access |
| 178 |
in the private user scope after dropping the privileges. |
| 179 |
|
| 180 |
* `--timeout=`[<value>]: |
| 181 |
Connection timeout in seconds. (Default: 10) |
| 182 |
|
| 183 |
* `-t`, `--tls`: |
| 184 |
Use direct TLS. |
| 185 |
|
| 186 |
* `--tls-version`=[<value>]: |
| 187 |
Minimal TLS version. 10 (TLSv1.0), 11 (TLSv1.1), 12 (TLSv1.2), 13 (TLSv1.3) (Default: 13) |
| 188 |
|
| 189 |
* `-u`, `--username`=[<value>]: |
| 190 |
Username for XMPP account (JID). |
| 191 |
|
| 192 |
* `-v`, `--verbose`: |
| 193 |
Show debug information. These can include sensitive data. |
| 194 |
|
| 195 |
* `--version`: |
| 196 |
Show version information. |
| 197 |
|
| 198 |
## ENVIRONMENT VARIABLES |
| 199 |
|
| 200 |
### HTTP_PROXY |
| 201 |
|
| 202 |
A SOCKS5 proxy can be used by setting the environment variable `HTTP_PROXY`. This feature is considered experimental |
| 203 |
and there is no guarantee that there won't be any connections not using the proxy although it didn't happen during |
| 204 |
testing. |
| 205 |
|
| 206 |
``` |
| 207 |
HTTP_PROXY="socks5://127.0.0.1:9050" go-sendxmpp --http-upload file.txt [email protected] |
| 208 |
``` |
| 209 |
|
| 210 |
## TIPS |
| 211 |
|
| 212 |
### USAGE BY ROOT |
| 213 |
|
| 214 |
In general it's a good advice to only perform commands as root when it is strictly necessary. To be able to send |
| 215 |
the output from commands, that need to be performed as root, with go-sendxmpp without invoking go-sendxmpp by |
| 216 |
root sudo can be used. |
| 217 |
|
| 218 |
In this example there is a user **sendxmpp** with a go-sendxmpp config in its `$HOME`: |
| 219 |
|
| 220 |
``` |
| 221 |
# command-that-requires-root|sudo -H -u sendxmpp go-sendxmpp [email protected] |
| 222 |
``` |
| 223 |
|
| 224 |
If go-sendxmpp is run as root it will drop the root privileges before connecting to the server. |
| 225 |
This means **FAST** and **OX** will be disabled as go-sendxmpp will not have the necessary rights to store |
| 226 |
the necessary data (e.g. FAST tokens or OX key material) after dropping the privileges. |
| 227 |
This is just to avoid network connections as root and doesn't mean that running as root as a supported use case, |
| 228 |
in fact it is highly recommended to never run go-sendxmpp as root. |
| 229 |
|
| 230 |
|
| 231 |
## SHELL COMPLETIONS |
| 232 |
|
| 233 |
### ZSH |
| 234 |
|
| 235 |
There are no shell completions yet (contributions welcome) but for zsh it is |
| 236 |
possible to automatically create completions from `--help` which might work |
| 237 |
good enough. |
| 238 |
|
| 239 |
Just place the following in your `~/.zshrc`: |
| 240 |
|
| 241 |
``` |
| 242 |
compdef _gnu_generic go-sendxmpp |
| 243 |
``` |
| 244 |
|
| 245 |
### FISH |
| 246 |
|
| 247 |
There are no shell completions yet, but FISH can generate them from the man page with following command: |
| 248 |
|
| 249 |
``` |
| 250 |
fish_update_completions |
| 251 |
``` |
| 252 |
|
| 253 |
## CHAT |
| 254 |
|
| 255 |
Feel free to join [https://join.jabber.network/#[email protected]?join](https://join.jabber.network/#[email protected]?join). |
| 256 |
|
| 257 |
## AUTHOR |
| 258 |
|
| 259 |
Written by Martin Dosch. |
| 260 |
|
| 261 |
## REPORTING BUGS |
| 262 |
|
| 263 |
Report bugs at [https://salsa.debian.org/mdosch/go-sendxmpp/-/work_items](https://salsa.debian.org/mdosch/go-sendxmpp/-/work_items). |
| 264 |
|
| 265 |
## COPYRIGHT |
| 266 |
|
| 267 |
Copyright (c) Martin Dosch |
| 268 |
License: BSD 2-clause License |
| 269 |
|
| 270 |
## SEE ALSO |
| 271 |
|
| 272 |
go-sendxmpp(5), xmppc(1), sendxmpp(1) |