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"
- }
- TO_LIST=""
- 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 =~ /[EMAIL PROTECTED]/ )
- {
- ....
- }
- but it doesn't works.
- if ( $FROM_LIST =~ /[EMAIL PROTECTED]/ )
Thanks in advance.
Alain
PS : I don't want to use the hasaddr() function because it only works with 'From:' headers.