You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Martin Dosch dc9c135ff3 cleanup 2 years ago
man Update docs. 2 years ago
.gitignore Initial commit 6 years ago
.gitlab-ci.yml Only show changes for current version in the release info. 2 years ago
CHANGELOG.md Update documention. 2 years ago
LICENSE Update copyright year 3 years ago
LICENSE-mellium Fix whitespaces in licenses. 4 years ago
README.md Update docs. 2 years ago
connect.go Use xmppsrv for SRV lookups. 3 years ago
const.go Add experimental key generation. 2 years ago
go.mod use etree 2 years ago
go.sum use etree 2 years ago
helpers.go Add experimental ox support. 2 years ago
httpupload.go Move constants in separate file. 2 years ago
iqhandling.go Add experimental ox support. 2 years ago
iqstructs.go use etree 2 years ago
jid.go Update copyright year 3 years ago
main.go bla 2 years ago
ox.go cleanup 2 years ago
parseconfig.go Remove duplicate line. 2 years ago

README.md

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

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

resource: <my_resource>

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] [-f value] [--help] [--http-upload value] [-j value] [-m value] [--muc-password value] [--ox] [--ox-genprivkey] [--ox-passphrase value] [-p value] [--raw] [-r value] [--timeout value] [--tls-version value] [-u value] [--version] [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.
     --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-genprivkey
                    Generate a public OpenPGP key for the given JID and publish
                    the corresponding public 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'.
     --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