1 message in net.sourceforge.lists.courier-maildrop[maildropl] Search for a good method ...
FromSent OnAttachments
Alain NAKACHEDec 29, 2003 3:19 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] Search for a good method to match From and To headersActions...
From:Alain NAKACHE (ala@cal.fr)
Date:Dec 29, 2003 3:19:39 am
List:net.sourceforge.lists.courier-maildrop

Hi all,

I search for a nice regexp to match exactly an address collected in From or To headers.

Here is the context : My maildroprc file builds 2 lists from headers 'From:' and 'To:':

TO_LIST="" foreach /^(to|cc|resend-to|resent-cc):.*/ { TO_LIST = "$TO_LIST$MATCH" } FROM_LIST="" foreach /^(From|X-Envelope-From|Envelope-Sender|Resent-Sender):.*/ { FROM_LIST = "$FROM_LIST$MATCH" } Now each variable is filled with a list of newline separated email addresses. In my $HOME/.mailfilter I want to match exactly an address in one of this 2 variables. My first try was to do like that :

if ( $FROM_LIST =~ /^myad@domain.com$/ ) { .... }

but it doesn't works. Where is my mistake ?

Thanks in advance. Alain

PS : I don't want to use the hasaddr() function because it only works with 'From:' headers.