procmail
[Top] [All Lists]

Re: Avoid Filters on a single domain

2001-01-19 16:05:34
Kip Turk wrote:
I have one domain that wants absolutely no filters on their domain.  What
is the simplest way to avoid processing the main procmailrc file for this
domain?  

H'rm, you mean like inserting

        :0
        * condition.showing.this.mail.is.for.nofilter.domain
        $DEFAULT

maybe before any of your "INCLUDERC=" lines in your /etc/procmailrc file?

Or are you asking how to actually code this line:
        * condition.showing.this.mail.is.for.nofilter.domain 

in the above recipe?  

There's an obvious sort of solution that looks like this:

        :0
        * ^TO_(_dot_)*(_at_)nofilter(_dot_)com\>
        $DEFAULT

but this isn't right because:

    1. it won't catch all email headed for nofilter.com.  Take a look
       at the headers in this email, for example; there is no
       "To:.*wcc.net" in it.

    2. If email is received that looks like this,

        To: jack(_at_)nofilter(_dot_)com
        cc: jill(_at_)please-scan4viruses(_dot_)com

       Jill's copy won't get filtered, just because it was also
       addressed to JACK.

In other words, it's both too broad and too narrow.

Now if you control (or can influence) the configuration of an MTA that
knows the envelope information, maybe you could get an X-Envelope-To:
header inserted to the mail.  Then your recipe could look like this:

        :0
        * ^X-envelope-to:(_dot_)*(_at_)nofilter(_dot_)com *$
        $DEFAULT

Perhaps you don't have that flexibility (it seems few of us do), and
in that case, here's my suggestion.  It hasn't been tested, no
guarantees, YMMV, etc.

Create a list of userids connected to nofilter.com.  I haven't done
this sort of thing, but I'm assuming that mail addressed to
jack(_at_)nofilter(_dot_)com and jane(_at_)nofilter(_dot_)com etc. get mapped 
to certain
userids on your box.  Perhaps all of them go to a single user's
mailbox; perhaps they go to different ones.  Anyway, make a file
containing the list of userids and put it in a nice place, say
/etc/procmailrcs/nofilter.userids.txt or something.  Maybe it looks
like this:

================ nofilter.userids.txt follows
# One userid per line; no leading or trailing blanks, and no comments 
# on them lines.  Comments begin with a '#' in column 1.
jack-nofilter
jane-nofilter
================ nofilter.userids.txt ends

Then in /etc/procmailrc, something like this...

    :0
    * ? grep -q '^'$LOGNAME'$' /etc/procmailrcs/nofilter.userids.txt
    $DEFAULT

would immediately store the inbound mail without doing any filtering,
in the execution of procmail to deliver mail to one of the userids
associated with nofilter.com .

hth
-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.
_______________________________________________
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>