procmail
[Top] [All Lists]

Re: Re. Procmail filter wrong name for email address

2010-09-15 08:31:52
On Wed, 15 Sep 2010, ProcMail wrote:

Hello
Can anyone help with a procmail filter to identify when the 'To:' field has the 
wrong name next to the email address
e.g. To: John Smith <mary(_at_)example(_dot_)com>

To do this I suppose I need to establish:
1.) The email is to mary(_at_)example(_dot_)com,
2.) The email is not To or CC additional people (i.e. to one person only),
3.) Any other name except 'mary' appears next to the email address.


Hi ProcMail

I'm sure this could be done. For example, testing a regular expression with grep

echo "mary Smith <mary(_at_)example(_dot_)com>" | grep -ic mary.*mary

gives 1

whilst

echo "John Smith <mary(_at_)example(_dot_)com>" | grep -ic mary.*mary

gives a count of 0.

So this type test could be implemented in a procmail recipe.

At this point, questions need to be asked. For instance, do you know all the email addresses that will need to be tested or will they just be random? If the former, you could set up a file of addresses to be tested. If the latter, I would have to think about it!

But I suspect you have presented us with the solution, rather than the problem, and are asking us how to implement it. In other words, why do you want to do this? Could there be some other solution?

--
Alan

(  Please address personal email to alan+1@ as email to lists@
   is only read from my subscribed lists. )

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

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