Removing mutt's send delay
I originally used mutt's built-in SMTP MTA. However, there is a considerable pause after hitting send. This can be disabled by using an external MTA with set sendmail_wait=-1
in muttrc
.
However, if I use msmtp
as the MTA, then there is no notification of errors (although msmtp
does write to logfile
as specified in ~/.msmtprc
).
Attempt to get notifications
From the command line, I can trigger a command when msmtp
fails.
</tmp/tosend msmtp -a default foo@bar.com --read-envelope-from || echo failed
Conceivably, I could mail a failure notification to my local *nix mail. However, this doesn't seem to work in mutt, if I set the following in muttrc
.
set sendmail = "/usr/bin/msmtp || date >> /tmp/msmtp.fail"
This causes all email to fail to send silently, with the following error in msmtp
's logfile
.
Nov 05 10:53:09 host=mail.bar.com tls=on auth=on user=foo@bar.com from=foo@bar.com recipients=||,date,>>,/tmp/msmtp.fail,foo@bar.com smtpstatus=501 smtpmsg='501 #5.1.1 bad address ' errormsg='recipient address >> not accepted by the server' exitcode=EX_DATAERR
Obviously, mutt
is parsing the extra parts of the command as recipients.
Question
Is there a way to get notifications of sent emails that fail, while sending in the background? I'm not tied to msmtp
necessarily.
exim
may be more robust, so I'll persist with working that out. I'll revisit your answer if I give up withexim
. – Sparhawk Nov 08 '15 at 22:46msmtp
as$sendmail
, and that worked fine. – Sparhawk Nov 11 '15 at 06:04