procmail
[Top] [All Lists]

Re: procmail and commas

1998-07-28 23:22:04
On Tue, Jul 28, 1998 at 07:08:54PM -0700, James Allen wrote:
I want a message to be filtered a certain way depending on how many commas
are in the To: field or CC: any suggestions????

Sure...

:0
* ^(To|Cc):.*,.*,.*,.*,.*,
{ action }

This simple recipe has many limitations, though.  It doesn't balance
between the To: and Cc: headers, for example.  You could break it up
into two recipes, one checking To: and one checking Cc::

:0
* ^To:.*,.*,.*,.*,.*,
{action if matched here}

:0
* ^Cc:.*,.*,.*,.*,.*,
{action if matched here}

Another problem is if the recipient has a comma in per name, e.g.:
To: "Morse, Samuel" <smores(_at_)camp(_dot_)fr>

The myriad ways of forming electronic mail addresses make it very 
difficult to check for possibilities such as this.  It can be done,
but may be more trouble than it's worth.  

Is this what you wanted?

Greg
-- 
Gregory S. Sutter                 Bureaucrats cut red tape -- lengthwise.
mailto:gsutter(_at_)pobox(_dot_)com
http://www.pobox.com/~gsutter/

Attachment: pgpJWMJTypO2y.pgp
Description: PGP signature

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