Go to file
2021-02-28 13:57:06 +01:00
man Add --raw documentation. 2021-01-31 12:28:58 +01:00
vendor Update vendored dependencies 2021-01-29 17:13:13 +01:00
.gitignore Initial commit 2018-08-04 12:16:28 +02:00
connect.go Look up SRV records for xmpp- and xmpps-client 2021-02-28 13:57:06 +01:00
go-sendxmpp.go Look up SRV records for xmpp- and xmpps-client 2021-02-28 13:57:06 +01:00
go.mod Use external package to get proper MIME types 2021-01-29 17:12:32 +01:00
go.sum Use external package to get proper MIME types 2021-01-29 17:12:32 +01:00
httpupload.go Use external package to get proper MIME types 2021-01-29 17:12:32 +01:00
jid.go Fix typos 2020-04-05 22:02:09 +02:00
LICENSE Fix whitespaces in licenses. 2020-04-04 14:20:03 +02:00
LICENSE-mellium Fix whitespaces in licenses. 2020-04-04 14:20:03 +02:00
README.md Add --raw documentation. 2021-01-31 12:28:58 +01:00

go-sendxmpp

about

A little tool to send messages to an XMPP contact or MUC inspired by sendxmpp.

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. :)

requirements

installation

If you have GOPATH set just run this commands:

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

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

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 ~/.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>
jserver: <jabber_server>
port: <jabber_port>
password: <your_jabber_password>

jserver and port might not be necessary depending on the used server. 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>

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 [-cdintx] [-f value] [--help] [--http-upload value] [-j value] [-m value] [-p value] [-r value] [-u value] [parameters ...]
 -c, --chatroom     Send message to a chatroom.
 -d, --debug        Show debugging info.
 -f, --file=value   Set configuration file. (Default: ~/.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.
 -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'. (Default: go-sendxmpp) [go-sendxmpp]
 -t, --tls          Use direct TLS.
 -u, --username=value
                    Username for XMPP account.
 -x, --start-tls    Use StartTLS. (DEPRECATED)

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