procmail
[Top] [All Lists]

Re: Dump email from specific sender

2000-08-16 12:32:09
At 12:36 2000-08-16 -0400, Mike O. wrote:
Case 1:
:0
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: myaddress(_at_)mydomain(_dot_)net
* ^From(_dot_)*jhodgins(_at_)moneymailer(_dot_)com
/dev/null

Q: why do you care if it it looped or not? You're dumping it after all (not autoreplying, which is the importance of the loop check), and presumably if you're dumping mail from this person, you're not also mailing them, so your loop identifier (which you'd need to be adding to messages) won't be appearing in messages from them.

Of course, if they knew that your recipe was written this way, they could simpy add the X-Loop to their messages to you, and it'd slip right through your filters.

Case 2:

:0
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: myaddress(_at_)mydomain(_dot_)net
* ^From(_dot_)*(_at_)moneymailer(_dot_)com
/dev/null

You are aware that if you'd dumping mail from anything at the domain, your first rule isn't necessary - this encompases both rules.


Would Case 1 dump email from this specific sender?

So long as they were mailing using the given email address in their mailer config. This includes email messages relayed through listservs (unless the listserv rewrites the From:).

Would Case 2 dump email from everyone(_at_)moneymailer(_dot_)com?

Those who's email address appears in the From: line, or when moneymailer.com is the message sender (so theoretically, if the server is theirs, and there are other domains on it, it could dump messages from other domains -- but only those who are hosted there).

What are the differences between:
* ^From(_dot_)*(_at_)moneymailer(_dot_)com

This catches either the From: header, or the From header (note no quote), which is the envelope sender. The most common example of the difference is mailing lists -- the From: is the person who sent the message to the list, whereas the From (when YOU get it), is the list mailer (and also has date info at the end of the line).

* ^From:(_dot_)*(_at_)moneymailer(_dot_)com

This catches only the From: header (what you see in a mailer as the From:)

------- and -------
* ^From*(_at_)moneymailer(_dot_)com

Time for you to pick up a text on RegExps I think. The '*' says "match zero or more of the previous character. In this case, that'd be 'm', and nothing else. '.' is a wildcard for 'any character', so ".*" matches any sequence of characters. The proper way to do the .com thing, BTW, is '\.com', though for most instances, it wouldn't make a big difference (well, you could get mail from "user(_at_)moneymailerxcom(_dot_)net", and an unescaped dot would match that domain - as I said, in most instances, it isn't likely to make a difference -- but you should get in the habit of escaping it where you actually want a DOT).

Anyway, the above regexp would match things like the following:

Frommmmm(_at_)moneymailer(_dot_)com
From(_at_)moneymailerxcom(_dot_)net

It WOULD NOT match:

From: someuser(_at_)moneymailer(_dot_)com

---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395


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