[exim] Re: Select a router per recipient on incoming message…

Top Page
Delete this message
Reply to this message
Author: Andrew C Aitchison
Date:  
To: Marco van Tol
CC: exim-users
Subject: [exim] Re: Select a router per recipient on incoming messages
On Wed, 20 Mar 2024, Marco van Tol via Exim-users wrote:

> Hi there,
>
> I apologise if this has been handled before. I wasn’t sure what a quick path in the FAQ would be to the answer for this.
>
> I have a domain for which different local_parts need to be delivered to different SMTP servers.
> The decision depends on whether "host-a" accepts the local_part, and otherwise it needs to be our local SMTP server.
>
>
> This works great, as long as you have one recipient per connection.
>
> But, when I tested what happened with 2 “RCPT TO” commands in a single connection, one for host-a, and one for local, I found out the contents of the acl_m_hosta is persistent between “RCPT TO” calls.
>
> Digging a bit further into this I found out that the router finds the variable in a state where the last verify left it, and all addresses would be handled by the same router.
>
> My question is this:
> Is there an easy way to decide per recipient which router will be used, based on the results of a callout/verify?
> Or is there a different way to establish the same result?


You are not using routers the way they are intended.

The idea is that *for each* address, each router is tried in turn until
one of them accepts the message, or specifies that it should be bounced.
See the Exim Spec, section 3.8 - Processing an address for delivery.

That should get you most of what you need.

-- 
Andrew C. Aitchison                      Kendal, UK
                    andrew@???


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/