Re: [exim] Smarthost condition by h_From header variable

Top Pagina
Delete this message
Reply to this message
Auteur: Mike Brudenell
Datum:  
Aan: Exim Users
Onderwerp: Re: [exim] Smarthost condition by h_From header variable
Hello,

Others on the list have pointed out that you might not actually be wanting
to use the value of the $h_From variable but instead the domain of the
envelope.

If you do decide to use the domain of the From header itself you might want
to do some additional testing, or write your test defensively… The
*Specification* does not state in its description of the
"${domain:<string>}" string expansion that the letters in its value are
converted to lower case. Therefore I'd be minded either to test the
expression when the From header contains a domain name in capital or mixed
case letters, or write the expression defensively and use "eqi" to compare
the two strings instead of "eq".

(In contrast the *Specification* does explicitly state that when Exim
assigns the value to the "$domain" variable it is first converted to lower
case.)

Cheers,
Mike B-)

On Thu, 21 Jun 2018 at 12:11, Gallai János via Exim-users <
exim-users@???> wrote:

> Dear Users,
>
> I am trying to create a smarthost manualroute route depending on From:
> header. Here is my router:
>
> smarthost:
>    driver = manualroute
>    domains = ! +local_domains
>    condition = ${if eq{${domain:$h_From:}}{domain.com}}
>    transport = remote_smtp
>    route_data = XXX.XXX.XXX.XXX
>    no_more

>
> What have I done wrong? Why is $h_From: variable empty in manualroute
> driver?
>
> How to make a correct condition to check the From header?
>
> Thanks in advance,
>
> János
>
>
>
> --
> ## List details at https://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/
>



--
Systems Administrator & Change Manager
IT Services, University of York, Heslington, York YO10 5DD, UK
Tel: +44-(0)1904-323811

Web: www.york.ac.uk/it-services
Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm