Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

match the "From: " domain, not "Return-Path: " (lookup{$sender_address_domain})

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


mangoo at wpkg

Nov 18, 2009, 3:32 AM

Post #1 of 5 (984 views)
Permalink
match the "From: " domain, not "Return-Path: " (lookup{$sender_address_domain})

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?


--
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/


exim-users at lists

Nov 18, 2009, 4:02 AM

Post #2 of 5 (941 views)
Permalink
Re: match the "From: " domain, not "Return-Path: " (lookup{$sender_address_domain}) [In reply to]

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:}

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

--
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/
Technical Blog: https://secure.grepular.com/blog/

--
## 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/


mangoo at wpkg

Nov 18, 2009, 4:21 AM

Post #3 of 5 (934 views)
Permalink
Re: match the "From: " domain, not "Return-Path: " (lookup{$sender_address_domain}) [In reply to]

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 [at] domain
To: admin <tch [at] example>


This got appended as a header:


Test: example.com:bob [at] domain


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

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

From: Some User <bob [at] domain>

I will have this match:

Some User <bob [at] domain>


I'd rather have only:

domain.tld

or:

bob [at] domain


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/


exim-users at lists

Nov 18, 2009, 4:29 AM

Post #4 of 5 (941 views)
Permalink
Re: match the "From: " domain, not "Return-Path: " (lookup{$sender_address_domain}) [In reply to]

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.
>
> headers_add = Test: $domain:$h_From:

I said: "${domain:$h_From:}" ... "$domain:$h_From:" has a completely
different meaning.

--
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/
Technical Blog: https://secure.grepular.com/blog/

--
## 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/


mangoo at wpkg

Nov 18, 2009, 5:47 AM

Post #5 of 5 (934 views)
Permalink
Re: match the "From: " domain, not "Return-Path: " (lookup{$sender_address_domain}) [In reply to]

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.
>>
>> headers_add = Test: $domain:$h_From:
>
> I said: "${domain:$h_From:}" ... "$domain:$h_From:" has a completely
> different meaning.

I must be blind - works perfectly - thanks!


--
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/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.