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: [email protected]
To: admin <[email protected]>


This got appended as a header:


Test: example.com:[email protected]


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

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

From: Some User <[email protected]>

I will have this match:

Some User <[email protected]>


I'd rather have only:

domain.tld

or:

[email protected]


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


-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to