procmail
[Top] [All Lists]

Re: Issue forwarding emails with procmail

2010-10-31 20:39:44
On Oct 31, 2010, at 3:27 PM, Roberto S. G. wrote:

Hi,
I'm using procmail to forward emails (instead of sendmail's ".forward"),
just in order to add "Resent-From" headers, so some domains be aware
that these are forwarded mails, and do not consider them spam just
because the original domain do not match the server it is being sent
from (SPF and so on)...

/chuckle
Do you really expect that to have the intended result?

Well, that doesn't matter.
The problem I've found is that when the final forward domain does not
exist, I end up with a loop, in which procmail sends away the message,
and also the error responses, which in turn, return immediately, and are
again forwarded... infinite loop.

Yup.
There's a trick to it.
You need to grab the first parameter passed to ProcMail by the invoking MTA, 
and stuff that into the "Return Path", but...
I don't have an example of it handy.

It may be similar to this, from the `man procmail` page, but am not sure, and 
you'll need to test:

              SENDER = "<$1>"                 # fix for empty sender addresses
              SHIFT = 1                       # remove it from $@

              :0                              # sink all junk mail
              * ^Subject:.*junk
              /dev/null

              :0 w                            # pass along all other mail
              ! -oi -f "$SENDER" "$@"

This doesn't occur with sendmail's ".forward", as it seems to know that
a bounce has occurred, and so, it deliver the bounces locally, so no
loop is built.
Can I program this clean behavior with procmail? (h0pe so!)
How?

Aloha,
Michael.
-- 
"Please have your Internet License             http://kapu.net/~mjwise/
 and Usenet Registration handy..."


____________________________________________________________
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>