On 11Nov2011 12:21, Martin Kj�r J�rgensen <[email protected]> wrote:
| Is there a way to make mutt listen or wait for msmtp succeeding or
| failing, and react accordingly? (or any other MTA for that matter)
Another method is to write a tiny shell script that calls
sendmail/msmtp/etc. If it fails, file the message in your "unsent"
folder. Untested uncommented example:
#!/bin/sh
set -ue
tmp=${TMPDIR:-/tmp}/tmp$$
trap 'rm -f "$tmp"; exit 0' 0
trap 'rm -f "$tmp"; exit 1' 1 3 15
cat >"$tmp"
${SENDMAIL:-sendmail} -oi ${1+"$@"} \
|| DEFAULT=your-unsent-folder procmail /dev/null <"$tmp"
exit 0
Then use that script in place of msmtp. Set $SENDMAIL to msmtp or
whatever.
Cheers,
--
Cameron Simpson <[email protected]> DoD#743
http://www.cskk.ezoshosting.com/cs/
... common sense can be the first victim of a genuine and often ardent desire
to improve the way things are done. Unfortunately, once common sense is
missing there is no limit to the damage that can unwittingly be done.
- Bjarne Stroustrup