procmail
[Top] [All Lists]

Re: Space insertion in header lines

1997-06-24 22:38:00
Robert Gahl <bgahl(_at_)thesphere(_dot_)com> writes:
I have finally gotten a working sendmail/procmail delivery agent
going on my HP box. I have procmail configured as follows in
sendmail.cf:

Mprocmail,      P=/usr/local/bin/procmail, F=DFMmShu, S=11/31, R=21/31,
                              T=DNS/RFC822/X-Unix, A=procmail -m $h $f $u

and mailertable has the following entry:

domain.com   procmail:/home/customers/domain/.procmailrc

How refreshing: a virtual domain setup that can actually work!
You should, however, remove the 'm' flag from the F= directive.
They fixed the default in sendmail 8.8.6 (released recently).


and inbound mail is getting channeled through the filter I have.

However, BCC's still don't seem to be found. I tried:

:0
* (^TO|^Received:.* for <?)username(_at_)domain(_dot_)com
! username(_at_)pop(_dot_)otherdomain(_dot_)com

You're still routing the message based on the header address(es),
instead of the envelope address which sendmail is nicely passing
to procmail as $2.  ($1 contains the envelope sender.)  Actually,
matching on the "for" clause of the Received: lines will often
work, as, if it exists, it will contain the envelope recipient.
You're better of doing this instead, as it will always work:


        RECIPT = $2

        :0
        * RECIPT ?? ^^username@
        ! username(_at_)pop(_dot_)otherdomain(_dot_)com

This puts the recipient in a variable that can be matched against using
the "var ??" condition special.  The double caret (_not_ carat) will
keep this from matching the address "anotherusername(_at_)domain(_dot_)com".  
Don't
worry about matching the domain: since only stuff to domain.com will
reach here, you don't need to check it.  If you had multiple mailertable
entries pointing at the same procmailrc then you would want to match
that part as well.


Philip Guenther

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