<commit_before>This is a Python script for running a command in the background and sending an
e-mail once it's done.  It should work in both Python 2.7 and Python 3.2+, the
only external dependency being [the python-daemon
module](https://pypi.python.org/pypi/python-daemon).


Usage
=====

    daemail.py [-e|--encoding <encoding>]
               [-E|--err-encoding <encoding>]
               [-f|--from|--sender <address>]
               [-F|--failed]
               [-l|--logfile <logfile>]
               [-m|--mail-cmd <command>]
               [-n|--nonempty]
               [--no-stdout]
               [--no-stderr]
               [--split]
               [-t|--to|--recipient|--rcpt <address>]
               <command> [<arg> ...]

Options
-------

- `-e <encoding>`, `--encoding <encoding>` — Expect the stdout (and stderr,
  unless overridden by `--err-encoding`) of `<command>` to be in the given
  encoding; defaults to the preferred encoding returned by Python's
  [`locale.getpreferredencoding`][preferred]

- `-E <encoding>`, `--err-encoding <encoding>` — Expect the stderr of
  `<command>` to be in the given encoding; defaults to the value specified via
  `--encoding` or its default

- `-f <address>`, `--from <address>`, `--sender <address>` — Set the `From:`
  address of the e-mail; defaults to the current user at the local host

- `-F`, `--failed` — Only send an e-mail if the command exits with a nonzero
  status

- `-l <logfile>`, `--logfile <logfile>` — If something goes wrong after
  daemonization that prevents any e-mails from being sent, append a report to
  `<logfile>`

- `-m <command>`, `--mail-cmd <command>` — Send e-mail by passing the message
  to `<command>` (executed via the shell) on stdin; default command: `sendmail
  -t`

- `-n`, `--nonempty` — Only send an e-mail if any output was captured

- `--no-stdout` — Don't capture the command's stdout; implies `--split`
<commit_msg>Document --dead-letter<commit_after>This is a Python script for running a command in the background and sending an
e-mail once it's done.  It should work in both Python 2.7 and Python 3.2+, the
only external dependency being [the python-daemon
module](https://pypi.python.org/pypi/python-daemon).


Usage
=====

    daemail.py [-D|--dead-letter <file>]
               [-e|--encoding <encoding>]
               [-E|--err-encoding <encoding>]
               [-f|--from|--sender <address>]
               [-F|--failed]
               [-l|--logfile <logfile>]
               [-m|--mail-cmd <command>]
               [-n|--nonempty]
               [--no-stdout]
               [--no-stderr]
               [--split]
               [-t|--to|--recipient|--rcpt <address>]
               <command> [<arg> ...]

Options
-------

- `-D <file>`, `--dead-letter <file>` — If an error occurs when trying to send,
  append the e-mail (including a description of the error) to `<file>`

- `-e <encoding>`, `--encoding <encoding>` — Expect the stdout (and stderr,
  unless overridden by `--err-encoding`) of `<command>` to be in the given
  encoding; defaults to the preferred encoding returned by Python's
  [`locale.getpreferredencoding`][preferred]

- `-E <encoding>`, `--err-encoding <encoding>` — Expect the stderr of
  `<command>` to be in the given encoding; defaults to the value specified via
  `--encoding` or its default

- `-f <address>`, `--from <address>`, `--sender <address>` — Set the `From:`
  address of the e-mail; defaults to the current user at the local host

- `-F`, `--failed` — Only send an e-mail if the command exits with a nonzero
  status

- `-l <logfile>`, `--logfile <logfile>` — If something goes wrong after
  daemonization that prevents any e-mails from being sent, append a report to
  `<logfile>`

- `-m <command>`, `--mail-cmd <command>` — Send e-mail by passing the message
  to `<command>` (executed via the shell) on stdin; default command: `sendmail
  -t`

- `-n`, `--nonempty` — Only send an e-mail if any output was captured

- `--no-stdout` — Don't capture the command's stdout; implies `--split`

{'fraction_non_alphanumeric': 0.1562962962962963, 'fraction_numerical': 0.0019753086419753087, 'mean_word_length': 2.492241379310345, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6754090', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1222, 'n_words': 469}