procmail
[Top] [All Lists]

Re: Empty envelope from when calling sendmail

2000-11-01 15:56:11
Marcel Janssen <maja(_at_)oce(_dot_)nl> writes:
We use procmail to filter all our mail. When sendmail processes mail, it
attaches a pseudo-domain ".PROCMAIL" and uses the procmail mailer. In the
procmailrc file we scan on subject and if there is no match, the mail is 
send back tosendmail using the rule:

:0         # Hand back to sendmail.
! -v  -oi -f "$@"
...
However, if the mail is coming from <> ( MAILER-DAEMON ) , we get the
following error:
...
Oct 27 18:08:26 smtp sendmail[8729]: SAA08729: setsender: : invalid or 
unparseable, received from root(_at_)localhost 
...
How do we tell sendmail (8.9.3 btw ) to include MAILER-DAEMON as
envelope-from or how do we tell procmail to correctly include the 
'<>' sending address when calling sendmail?

Hmm, fixing it in sendmail might not be trivial: C code will probably
be required.  The work around on the procmail side is to extract the
sender from the argument list and wrap it in <>s.

        SENDER = "<$1>"
...
        :0 w
        ! -v -oi -f "$SENDER" "$@"

Note the 'w' flag on the recipe.  That'll cause procmail to return failure
if sendmail does.  Otherwise the message will be lost.

Note that sendmail doesn't care if there's an extra pair of angle brackets
(i.e., "<<foo>>" is the same as "<foo>" as far as sendmail is concerned),
but if you want, you can suppress them on the procmail side:

        SENDER = $1
        # Add <>s if they aren't there already
        :0
        * ! SENDER ?? ^^<
        { SENDER = "<$SENDER>" }

I'll look at submitting a bug-report/patch to the sendmail people.


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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