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

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Marco van Tol
Date:  
À: Andrew C Aitchison
CC: Marco van Tol, exim-users
Sujet: [exim] Re: Select a router per recipient on incoming messages
Op 20 mrt 2024, om 23:32 heeft Andrew C Aitchison <andrew@???> het volgende geschreven:
> 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.


Hi, thank you for your reply, and also thanks to Jeremy who wrote more-or-less the same thing.

I have tried to find a routers config that will do this:
- try to deliver an address over smtp
- if the returned error is permanent, try the next router

This is what I would need, unless I’m overlooking something.

From what I read fallback_hosts will only try the next router on temporary failures.

I only need to try delivery to an alternative host/router if the current host/router returns a permanent error.

I looked at the options for the smtp transport, the generic routing options and the manualroute routing options, but from the documentation it doesn’t click with me that this is possible. Is it?

Sorry if I overlooked something super simple.

Thanks in advance,

Marco van Tol



--
## 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/