procmail
[Top] [All Lists]

Re: Filter based on length of the From address?

2003-09-22 11:06:02
Brian Nesbit asked,

I was trying to find some insight on how I can filter based on the length of the From address.

Not enough to go on.  Do you mean the envelope sender address in the
"From " pseudo-header, or do you mean the RFC2822 address in the From: header? If the latter, are you including the formal name or do you want it just stripped down to the email address?

Specifically I want to filter anything with a From address greater than 55 characters in length ...

"Greater than fifty-five characters" is specific but "From address" is extremely vague.

If you mean the envelope sender,

 :0 flags
 * ^From +\/[^ ]+
 * 1^1 MATCH ?? .
 * -55^0
 action

If you mean the contents of the From: header, formal name and other comments and all,

 :0 flags
 * ^From:.*\/[^         ].*
 * 1^1 MATCH ?? .
 * -55^0
 action

If you want the From: contents stripped down to the email address, that's more involved; if I were sure that was what you meant, I'd cover that as well, but it's not worth it just on a guess.


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