procmail
[Top] [All Lists]

Re: How to stop mail loop

2000-03-15 08:30:57
At 06:20 2000-03-15 -0800, Ron 'The InSaNe One' Rosson wrote:
> * ^To: *all(_at_)domain(_dot_)com

oops, typo on my part, should technically be:
* ^To:(_dot_)*all(_at_)domain\(_dot_)com

In answer to your question about how to match JUST this address, you'd need to match for common address delimiters:

* ^To:.*([      ]*|,|\<|\()all(_at_)domain(_dot_)com

the brackets contain a space and a hard tab.  SO you're matching for
        space
        tab
        comma
        open bracket <
        open paren (

a doublequote might be appropriate to add as well, though that's still catching malformed address specifications.

The above _should_ match such constructs as:

 To: somebody else, all(_at_)domain(_dot_)com
        (with or without the space between the command and the address)
 To: all(_at_)domain(_dot_)com
 To: "Those guys" <all(_at_)domain(_dot_)com>
 To: malformed (all(_at_)domain(_dot_)com)


However, implementing this in sendmail as previously described would be more sure-fire. What if this address receives the message BCC (or CC: for that matter)?

You can replace 'To:' with 'TO_' and simplify it (TO is a special procmail regexp macro):

* ^TO_all(_at_)domain\(_dot_)com

Which will catch it in Cc: headers, and in the received lines if your MTA injects BCC delivery information there (still a crapshoot if there were multiple local recipients).

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

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