Go to file
2023-01-11 07:04:03 +01:00
man Improve manpage formatting. 2022-11-27 09:13:58 +01:00
.gitignore Initial commit 2018-08-04 12:16:28 +02:00
.gitlab-ci.yml CI: Strip binaries. 2022-07-24 17:30:27 +02:00
CHANGELOG.md Start new development cycle. 2022-11-11 18:26:22 +01:00
connect.go Fix typo in license header. 2022-05-02 17:13:50 +02:00
const.go Start new development cycle. 2022-11-11 18:26:22 +01:00
go.mod Update go modules. 2023-01-10 18:38:44 +01:00
go.sum Update go modules. 2023-01-10 18:38:44 +01:00
helpers.go Move string validation into own helper function. 2022-11-05 12:40:40 +01:00
httpupload.go Update comment. 2022-11-26 12:33:12 +01:00
jid.go Update copyright year 2021-03-03 11:48:27 +01:00
LICENSE Update copyright year 2021-03-03 11:48:27 +01:00
LICENSE-mellium Fix whitespaces in licenses. 2020-04-04 14:20:03 +02:00
main.go Merge branch 'master' into restructure-xml-stanzas 2022-11-16 14:52:24 +01:00
ox.go first functions cleaned up 2022-11-05 13:53:08 +01:00
oxstanzas.go first functions cleaned up 2022-11-05 13:53:08 +01:00
parseconfig.go Deprecate resource setting and introduce alias setting. 2022-08-06 11:52:47 +02:00
README.md Add short option -h for http-upload. 2022-11-11 17:54:00 +01:00
stanzahandling.go Improve error handling in XML parsing. 2022-09-02 11:05:42 +02: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

installation

repositories including go-sendxmpp

Packaging status

manual installation

Go < 1.16

$ go get -u salsa.debian.org/mdosch/go-sendxmpp

Go >= 1.16

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] [--help] [--http-upload value] [-j value] [-m value] [--muc-password value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [-p value] [--raw] [-r value] [--timeout value] [--tls-version value] [-u value] [--version] [parameters ...]
 -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)
     --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).
     --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.
 -r, --resource=value
                    Set resource. When sending to a chatroom this is used as
                    'alias'. DEPRECATED: Use --alias instead.
     --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