procmail
[Top] [All Lists]

Re: address/domain matching question

2003-04-04 09:10:17
On Fri, Apr 04, 2003 at 09:13:50AM -0600, Jason Crowe wrote:
Here is my recipe segment:
-------------------------------------------------------
FRIENDS=/etc/procmail/friends
:0
* ? (formail -x From: -x Sender: -x Resent-From: | fgrep -iqf $FRIENDS)
-------------------------------------------------------
What can I do to this recipe to have it match user(_at_)domain1(_dot_)com or
@domain2.com?

There are some time I want to match an entire domain, but others I
want to match only the single address for a domain.

Example:  I want to match customer(_at_)hotmail(_dot_)com but not
spam(_at_)hotmail(_dot_)com

This is what this currently will do if customer(_at_)hotmail(_dot_)com is in
the $FRIENDS file.  I would also like this to match entire domains
that are legit, like @customer.com

Is it possible to use both formats from the same $FRIENDS file?

Just put whatever strings you want to match in the file, one per
line; then use the -x flag to fgrep.  You will want the -z flag for
formail, also.  I don't think you need the parentheses.

 * ? formail -x From: -x Sender: -x Resent-From: -z | fgrep -iqxf $FRIENDS

-- 
dman



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