procmail
[Top] [All Lists]

forwarding with properly delivered bounces

2006-01-09 14:02:19

Hello,

I am trying to design a forwarding recipe for procmail, which, contrary to
one given at http://www.openspf.org/faq.html#forwarding, would handle
bounces properly, i.e. return them to original sender. This one works for
me, but before putting it into production, I would appreciate an opinion
of seasoned procmail users.

In particular, the recipe assumes that the header of the original message
is included in the body of the bounce message. Is it always true, or at
least most often true?

Another question: how should this behave in case of forwarding through
multiple forwarders? I am afraid it could still cause a loop...

Thanks,
Alex

PS My first posting did not reach me, I apologize for possible
double posting




# Local address to deliver bounces whose origin is not found
BOUNCES=admin(_at_)of(_dot_)this(_dot_)site

# Forwarding addresses must be specified in this file, one per line
# If we do not want local copy, create ~/.forward.p.noloc,
# otherwise ~/.forward.p.loc, but bounces are delivered locally in that
case FWDADDRSNL=`/bin/awk '{ printf "%s,",$0 } END { print }' \
  $HOME/.forward.p.noloc`
:0
* ! FWDADDRSNL ?? ^^^^
{
  :0 fw
  * !^X-Loop: SiteID
  | /usr/bin/formail -A"X-Loop: SiteID" \
                     -R Return-Path X-Loop-SiteID-Return-Path
  :0 Aw
  * !^FROM_DAEMON
  ! $FWDADDRSNL

  :0 B
  * ^X-Loop-SiteID-Return-Path: *\/.*
  { ORIGSENDER = ${MATCH} }
  :0 A
  * ! ORIGSENDER ?? ^^^^
  ! $ORIGSENDER

  :0 fw
  | /usr/bin/formail -i"Subject: bounced forward for $LOGNAME"
  :0
  ! $BOUNCES

}
FWDADDRSL=`/bin/awk '{ printf "%s,",$0 } END { print }' \
   $HOME/.forward.p.loc`
:0 E
* ! FWDADDRSL ?? ^^^^
{
  :0 fw
  * !^X-Loop: SiteID
  | /usr/bin/formail -A"X-Loop: SiteID" \
                     -R Return-Path X-Loop-SiteID-Return-Path
  :0 Awc
  * !^FROM_DAEMON
  ! $FWDADDRSL
}



____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>