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 c4714e9f8f Merge branch 'patch-1' into 'master'
Allow 640 (group read) permissions

Closes #1

See merge request mdosch/go-sendxmpp!3
4 years ago
man Update documentation 4 years ago
vendor Update vendored dependencies. 4 years ago
.gitignore Initial commit 6 years ago
LICENSE Fix whitespaces in licenses. 4 years ago
LICENSE-mellium Fix whitespaces in licenses. 4 years ago
README.md Update documentation 4 years ago
go-sendxmpp.go Allow 640 permissions 4 years ago
go.mod Update vendored dependencies. 4 years ago
go.sum Update vendored dependencies. 4 years ago
httpupload.go Check for http status code. 4 years ago
jid.go Fix typos 4 years ago

README.md

go-sendxmpp

about

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

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. 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.
 -r, --resource=value
                    Set resource. When sending to a chatroom this is used as
                    'alias'. (Default: go-sendxmpp) [go-sendxmpp]
 -t, --tls          Use TLS.
 -u, --username=value
                    Username for XMPP account (JID).
 -x, --start-tls    Use StartTLS.

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