Preventing error mails to sender
April 25, 2006, 2:33 pm
Filed under: notes/General
Filed under: notes/General
The following is procmail code to forward any incoming mail to xxxxxxx@wm.pdx.ne.jp, while modifying the header so that any failure to forward to xxxxxxx@wm.pdx.ne.jp will not send error mail to original sender of the email, but instead to xxxxxxx@gmail.com.
:0 c # leave copy
* < 1024000
{
:0fwh:
| formail -k -X "From:" -X "Subject:" \
-I "To: xxxxxxx@wm.pdx.ne.jp" -X "To:" \
-I "X-Loop: xxxxxxx@wm.pdx.ne.jp" -X "X-Loop:" \
-I "Return-Path: xxxxxxx@gmail.com" -X "Return-Path" \
-I "Errors-To: xxxxxxx@gmail.com" -X "Errors-To"
:0c
! xxxxxxx@wm.pdx.ne.jp
}
References:
Common Internet Message Header Fields
Procmail FAQ
Formail manual
Leave a Comment


