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 [email protected] --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 [email protected] [email protected] recipients=||,date,>>,/tmp/msmtp.fail,[email protected] 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.