Go to file
2022-02-07 16:57:31 +01:00
man Remove deprecated option -x. 2022-02-07 16:55:38 +01:00
.gitignore Initial commit 2018-08-04 12:16:28 +02:00
.gitlab-ci.yml Update CI. 2022-01-27 17:33:41 +01:00
CHANGELOG.md Update changelog. 2022-02-07 16:57:31 +01:00
connect.go Use xmppsrv for SRV lookups. 2021-09-29 18:18:58 +02:00
go-sendxmpp.go Remove deprecated option -x. 2022-02-07 16:55:38 +01:00
go.mod Update modules. 2022-01-29 14:42:07 +01:00
go.sum Update modules. 2022-01-29 14:42:07 +01:00
httpupload.go Improve renaming of files for http-uplad 2022-01-29 14:11:52 +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
README.md Remove deprecated option -x. 2022-02-07 16:55:38 +01:00

go-sendxmpp

about

A little 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

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

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/sendxmpprc 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 resource (and nickname for MUCs) via the resource setting:

resource: <my_resourceY>

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 [-cdilntx] [-f value] [--help] [--http-upload value] [-j value] [-m value] [-p value] [--raw] [-r value] [-u value] [parameters ...]
 -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.
     --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.
 -n, --no-tls-verify
                    Skip verification of TLS certificates (not recommended).
 -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'.
 -t, --tls          Use direct TLS.
 -u, --username=value
                    Username for XMPP account.

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