I'm trying to receive a bounce mail message when an outgoing message cannot reach smtp external server (due to my local internet connection problems).
I send emails using: mutt (compose) - procmail - esmtp (in place of sendmail) - GMail smtp server
When my connection is down and gmail smtp cannot be reached, I need to be alerted with a bounce mail from my email local system.
Is procmail the right "link in the chain" to set up to obtain this behavior? How configure it for bouncing?
EDIT:
.muttrc
:
set sendmail="/usr/bin/formail -s /usr/bin/procmail -t -m /home/$myuser/.procmailoutrc"
.procmailoutrc
:
MAILCONF=$HOME/.mail
LOGFILE=$MAILCONF/procmailout.log
LOGSENDMAIL=$MAILCONF/esmtp.log
[...]
:0
* ^From.*address@gmail
{
:0c:
address@gmail
:0
| formail -I 'From ' | sendmail -v -t -X "$LOGSENDMAIL"
}
esmtprc
:
identity address@gmail
hostname smtp.gmail.com:587
username "address@gmail"
password "*"
starttls required
helo "*"
mda='/usr/bin/formail -a "Date: `date -R`" | /usr/bin/procmail -d %T'`
Since I found following error:
"SMTP server problem Temporary failure in name resolution"
written in $LOGFILE
and not in $LOGSENDMAIL
, I thought procmail was able to manage this returned error and send a "delivery failed" message to my mailbox.
As you can see in my config, mboxes name is the same of the real email address...
formail -s
there -- why don't you simply pipe toprocmail
?