#email #cli #command

app cmail

Send email with the output of long running commands

4 releases (2 breaking)

0.3.0 Aug 1, 2018
0.2.0 Feb 23, 2018
0.1.1 Jul 16, 2015
0.1.0 Jul 14, 2015

#27 in Email

Download history 5/week @ 2018-05-10 1/week @ 2018-05-17 3/week @ 2018-05-24 20/week @ 2018-05-31 2/week @ 2018-06-07 4/week @ 2018-06-14 4/week @ 2018-06-21 24/week @ 2018-06-28 12/week @ 2018-07-05 4/week @ 2018-07-12 11/week @ 2018-07-19 1/week @ 2018-07-26 30/week @ 2018-08-02

40 downloads per month

A command line utility for sending periodic email with the output of long running commands.

Build status

Dual-licensed under MIT or the UNLICENSE.

Installation

Currently, you have to build with Cargo, Rust's package manager. I'll hopefully release binaries soon.

git clone git://github.com/BurntSushi/rust-cmail
cd rust-cmail
cargo build --release
./target/release/cmail --help

Usage

Usage: cmail [options] [<args> ...]

Options:
    -h, --help             Display this help message.
    -p ARG, --period ARG   Data is emailed at this period in seconds.
                           Set to 0 to disable and send only one email
                           when the command completes.
                           [default: 900]
    -s, --silent           Don't pass the command's stdout/stderr to the
                           terminal. Instead, only send stdout/stderr
                           in email.
    -a, --send-all         Send the entire command's output on each email.
                           N.B. This saves all output in memory.
    -t ARG, --to ARG       The email address to send to. By default, this
                           is set to $EMAIL. If neither $EMAIL nor --to
                           are set, then an error is returned.

cmail responds gracefully to signals or if the command being run is terminated unexpectedly. Internally, cmail uses sendmail to send email.

Examples

Send whatever is on stdin:

cmail <<EOF
This is going to
my email
EOF

Report all 80 column violations in Lua files. Don't show output in terminal:

find ./ -name '*.lua' -print0 | xargs -0 colcheck | cmail -s

Run a du command on a huge directory, and send an incremental email update every 10 seconds (the default is 15 minutes):

cmail -p 10 du -csh *

Port from Go

This is ported from an earlier version I wrote in Go: https://github.com/BurntSushi/rust-cmail

Since this is my second run at writing this, it's a little clean this time around. All in all, I'm quite fond of the structure of both programs (well, the structure is quite similar!).

Unlicense/MIT license

Dependencies

Reverse deps