Go to file
2024-01-10 22:42:55 +01:00
man Fix typo. 2024-01-09 21:56:16 +01:00
.gitignore Initial commit 2018-08-04 12:16:28 +02:00
.gitlab-ci.yml CI: Disable golangci-lint for now. 2023-06-04 16:50:44 +02:00
CHANGELOG.md Fix typo. 2024-01-09 11:52:09 +01:00
connect.go Update go modules. 2024-01-10 16:21:39 +01:00
const.go Start new development cycle. 2024-01-09 11:39:58 +01:00
go.mod Update go modules. 2024-01-10 22:42:55 +01:00
go.sum Update go modules. 2024-01-10 22:42:55 +01:00
helpers.go Don't unwrap errors when checking errors. 2023-08-16 08:49:43 +02:00
httpupload.go Update go modules. 2024-01-10 16:21:39 +01:00
jid.go gofumpt 2023-06-06 10:47:40 +02:00
LICENSE Remove copyright years. 2023-05-11 20:06:23 +02:00
LICENSE-mellium Fix whitespaces in licenses. 2020-04-04 14:20:03 +02:00
main.go Update go modules. 2024-01-10 16:21:39 +01:00
ox.go Update go modules. 2024-01-10 16:21:39 +01:00
parseconfig.go Remove deprecated flag resource. 2023-09-05 20:39:54 +02:00
README.md Update go modules. 2024-01-10 16:21:39 +01:00
stanzahandling.go Update go modules. 2024-01-10 16:21:39 +01:00

go-sendxmpp

about

A tool to send messages to an XMPP contact or MUC inspired by sendxmpp. You can find other sendxmpp alternatives in the XSF wiki.

support

You might join the chat if you have problems, want to contribute or just want to talk about the project. You might also talk about any of the other sendxmpp incarnations. :)

Go-sendxmpp MUC badge

requirements

  • go >= 1.21

installation

repositories including go-sendxmpp

Packaging status

manual installation

Latest release:

$ go install salsa.debian.org/mdosch/go-sendxmpp@latest

Current development version:

$ go install salsa.debian.org/mdosch/go-sendxmpp@master

You will find the binary in $GOPATH/bin or, if set, $GOBIN.

binaries

There are some (automatically built and untested) binaries linked to the release.

usage

You can either pipe a programs output to go-sendxmpp, write in your terminal (put ^D in a new line to finish) or send the input from a file (-m or --message).

The account data is expected at ~/.config/go-sendxmpp/config if no other configuration file location is specified with -f or --file. The configuration file is expected to be in the following format:

username: <your_jid>
password: <your_jabber_password>

If this is not sufficient to connect you might also specify jserver and port. It is also possible to use a password manager. In this case the password setting should be replaced by the eval_password setting:

eval_password: <command_to_unlock_your_password>

You can also configure the alias/nickname for MUCs via the alias setting:

alias: <my_alias>

If no configuration file is present or if the values should be overridden it is possible to define the account details via command line options:

Usage: go-sendxmpp [-cdilnt] [-a value] [-f value] [--headline] [--help] [-h value] [-j value] [-m value] [--muc-password value] [--oob-file value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [-p value] [--raw] [--timeout value] [--tls-version value] [-u value] [--version] [recipients…]
Usage: go-sendxmpp [-cdilnt] [-a value] [-f value] [--headline] [--help] [-h value] [-j value] [-m value] [--muc-password value] [--oob-file value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [-p value] [--raw] [--scram-mech-pinning value] [--timeout value] [--tls-version value] [-u value] [--version] [recipients…]
 -a, --alias=value  Set alias/nicknamefor chatrooms.
 -c, --chatroom     Send message to a chatroom.
 -d, --debug        Show debugging info.
 -f, --file=value   Set configuration file. (Default:
                    ~/.config/go-sendxmpp/sendxmpprc)
     --headline     Send message as type headline.
     --help         Show help.
 -h, --http-upload=value
                    Send a file via http-upload.
 -i, --interactive  Interactive mode (for use with e.g. 'tail -f').
 -j, --jserver=value
                    XMPP server address.
 -l, --listen       Listen for messages and print them to stdout.
 -m, --message=value
                    Set file including the message.
     --muc-password=value
                    Password for password protected MUCs.
 -n, --no-tls-verify
                    Skip verification of TLS certificates (not recommended).
     --oob-file=value
                    URL to send a file as out of band data.
     --ox           Use "OpenPGP for XMPP" encryption (experimental).
     --ox-delete-nodes
                    Delete existing OpenPGP nodes on the server.
     --ox-genprivkey-rsa
                    Generate a private OpenPGP key (RSA 4096 bit) for the given
                    JID and publish the corresponding public key.
     --ox-genprivkey-x25519
                    Generate a private OpenPGP key (x25519) for the given JID
                    and publish the corresponding public key.
     --ox-import-privkey=value
                    Import an existing private OpenPGP key.
     --ox-passphrase=value
                    Passphrase for locking and unlocking the private OpenPGP
                    key.
 -p, --password=value
                    Password for XMPP account.
     --raw          Send raw XML.
     --scram-mech-pinning=value
                    Enforce the use of a certain SCRAM authentication mechanism.
     --timeout=value
                    Connection timeout in seconds. [10]
 -t, --tls          Use direct TLS.
     --tls-version=value
                    Minimal TLS version. 10 (TLSv1.0), 11 (TLSv1.1), 12
                    (TLSv1.2) or 13 (TLSv1.3). [12]
 -u, --username=value
                    Username for XMPP account.
     --version      Show version information.

examples

Send a message to two recipients using a configuration file.

cat message.txt | ./go-sendxmpp -f ./sendxmpp recipient1@example.com recipient2@example.com

Send a message to two recipients directly defining account credentials.

cat message.txt | ./go-sendxmpp -u bob@example.com -j example.com -p swordfish recipient1@example.com recipient2@example.com

Send a message to two groupchats (-c) using a configuration file.

cat message.txt | ./go-sendxmpp -cf ./sendxmpp chat1@conference.example.com chat2@conference.example.com

Send file changes to two groupchats (-c) using a configuration file.

tail -f example.log | ./go-sendxmpp -cif ./sendxmpp chat1@conference.example.com chat2@conference.example.com

shell completion

zsh

There are no shell completions yet (contributions welcome) but for zsh it is possible to automatically create completions from --help which might work good enough.

Just place the following in your ~/.zshrc or ~/.zshrc.local:

compdef _gnu_generic go-sendxmpp