Re: [exim] Smarthost condition by h_From header variable

Top Page
Delete this message
Reply to this message
Author: Heiko Schlittermann
Date:  
To: exim-users
Subject: Re: [exim] Smarthost condition by h_From header variable
Hi,

Gallai János via Exim-users <exim-users@???> (Do 21 Jun 2018 08:34:39 CEST):
> 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?


Depends on when the router is run.

If you call the router implicitly from the ACL (require verify =
recipient, … or similiar) there is hot header yet.

If you test the router using `exim -bt …` it won't work, for the same
reason, as there is no header yet.

Better router testing you can do using Exim's -N option and a
handcrafted message.

If the message is received already, the header is set and the router
should work.

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -