Re: [exim] Decide what router to use according to the from f…

Góra strony
Delete this message
Reply to this message
Autor: Lena
Data:  
Dla: exim-users
Temat: Re: [exim] Decide what router to use according to the from field
> From: Red Blue

> What I am trying to accomplish is to use the send_via_ses router only if the envelope from field belongs to a local?domain.
>
> For some reason, the router is being ignored even when the from field belongs to a local domain.
>
> I have tried to use that acl condition to acl_smtp_rcpt and acl_smtp_data as well but I got the same behavior.
>
> Any ideas on what's wrong?
>
> router:
>
> send_via_ses:
> driver = manualroute
> domains = ! +local_domains


The exclamation sign means "not".

> transport = ses_smtp
> route_list = * email-smtp.us-west-2.amazonaws.com;
> condition = ${if eq{$acl_m_use_ses}{1} {yes}{no}}
>
>
> ACL:
>
> acl_smtp_mail:
> ??? warn
> ?????? condition = ${if or{\
> ??????? {match_domain{${domain:$h_From:}}{+local_domains}}\
> ??????? {match_domain{$sender_address_domain}{+local_domains}}\
> ??????? }{yes}{no}}
> ?????? set acl_m_use_ses=1


$h_* variables are available only after header and body are transmitted,
i.e. in acl_smtp_data. When acl_smtp_mail is exectuted, header and body
weren't transmitted yet.
Routers are executed for the first time in the verify mode
when acl_smtp_rcpt says "verify=recipient",
also before transmission of header and body.