[maildropl] Search for a good method to match From and To headers
Brought to you by:
mrsam
|
From: Alain N. <al...@ca...> - 2003-12-29 11:19:21
|
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 =~ /^mya...@do...$/ )
{
....
}
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.
|