Re: [exim] match the "From: " domain, not "Return-Path: " (l…

Top Page
Delete this message
Reply to this message
Author: Tomasz Chmielewski
Date:  
To: Mike Cardwell
CC: Exim Users List
Subject: Re: [exim] match the "From: " domain, not "Return-Path: " (lookup{$sender_address_domain})
Mike Cardwell wrote:
> Tomasz Chmielewski wrote:
>
>> Right now, I can look up the sender's domain in "Return-Path: " with
>> lookup{$sender_address_domain}.
>>
>> I would like to decide about what happens with a mail based on its
>> "From: " address, rather than "Return-Path: ".
>>
>> Can I do a similar check for a domain name used in the "From: " field?
>
> Instead of $sender_address_domain, use ${domain:$h_From:}


Hmm, doesn't seem to work properly.

It didn't work for me, so I added these to see what gets matched:


headers_add = Test: $domain:$h_From:


With these values in message headers:

From: bob@???
To: admin <tch@???>


This got appended as a header:


Test: example.com:bob@???


So I think I wasn't exactly clear with my question.

If I use ${$h_From:}, for this From: header:

From: Some User <bob@???>

I will have this match:

Some User <bob@???>


I'd rather have only:

domain.tld

or:

bob@???


I guess I need to construct some regexp, but I'm not sure how.



> Please remember, there are cases where both of those variables can be blank.


Yes, I'm aware.
It's just a workaround for deficiencies in local webmail, so it won't be
a problem.


--
Tomasz Chmielewski
http://wpkg.org