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

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: rblue
Fecha:  
A: exim-users
Asunto: Re: [exim] Decide what router to use according to the from field
Thanks a lot for, once again, your detailed explanation. I now
understand how the routers get processed.

I enabled -d+all and noticed the router is still not being used, even
though the acl condition is now being true (after I moved it to
acl_smtp_data) and the variable is set:

03:33:05 23930 expanding: ${if 
or{{match_domain{${domain:$h_From:}}{+local_domains}}{match_domain{$sender_address_domain}{+local_domains}}}{yes}{no}}
03:33:05 23930    result: yes


Again, this is the condition in the acl:

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


And this is the condition in the router:

send_via_ses:
driver = manualroute
transport = ses_smtp
route_list = * email-smtp.us-east-1.amazonaws.com;
condition = ${if eq{$acl_m_use_ses}{1} {yes}{no}}
verify = false

My goal is to only use the send_via_ses router if the From field in the
header belongs to a local domain.

From what I saw in the debugging messages, the send_via_ses router was
skipped during the verification process, like you previously said, but
it was never "rechecked" after the data phase, any ideas why?


On 7/22/2014 5:52 PM, Todd Lyons wrote:
> Bringing this back on list.
>
> On Tue, Jul 22, 2014 at 4:41 PM, rblue <rblue117@???> wrote:
>> Hi,
>>
>> After a few tests, it looks like the variable isn't being used properly in
>> the router because the data acl runs only after the router is decided - is
>> that right? If so, is there any way to tell exim to choose the router only
>> after the acl_smtp_data acl, which is where I can look up the $h_From
>> variable?
> I've been pushing you in the general direction. Now I'm going to hold
> your hand.
>
>>> Now, having said that, *WHEN* is this being called? Is this part of
>>> the router process for delivery (i.e. at the end of the DATA phase)?
>>> Or is the part of the router processing during address verification,
>>> typically in the MAIL and RCPT acl's. It appears to be during the
> In a somewhat standard configuration, the routers are processed 3 times:
> 1) Once during the acl_smtp_mail when it's processing verify=sender.
> It passes the MAIL FROM (envelope sender) address through the routers
> attempting to verify if it's a valid sender.
> 2) Once during the acl_smtp_rcpt when it's processing
> verify=recipient. It passes *all* RCPT TO (envelope recipients)
> addresses through the routers, attempting to verify if they are emails
> it should be accepting (i.e. local domains, or from designated hosts
> that you forward any received emails...if you are a smarthost).
> 3) After the email has been accepted (i.e. after the data phase), when
> Exim is actually trying to deliver the message.
>
> Conditions are just for *verification*. So if you don't want your
> particular special router to do anything during the verification
> phases, and only be processed during the actual delivery of the email
> (i.e. after the data phase, when there is actually message headers
> available to inspect), then add to your router:
>
>    verify = false

>
> Make sure that there is a router that will accept the emails that this
> particular router normally accepts (because if there is not, then the
> email address won't pass verification during the rcpt acl, and your
> exim will reject it).
>
> ...Todd