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

Top Page
Delete this message
Reply to this message
Author: Marco van Tol
Date:  
To: exim-users
CC: Marco van Tol
Subject: [exim] Re: Select a router per recipient on incoming messages
Hi Again,

I found something that works. So now all that’s left is that I wonder if any of you would have a more readable version.

I will type what I changed to make it work inline below.


Op 20 mrt 2024, om 14:36 heeft Marco van Tol <mvantol@???> het volgende geschreven:
> 
> 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.
> 
> I created these relevant config snippets for it:
> (I did not paste the entire config file, just the parts relevant to my question)
> 
> ```
> local_domains = mydomain.tld
> 
> begin acl
>   acl_smtp_rcpt:
>     accept domains = +local_domains
>            verify = recipient/callout
>            set acl_m_hosta = "ok"


This I changed to:
            set acl_m_hosta = $acl_m_hosta ${tr{$local_part}{=}{_}}@$domain=hosta

> 
>     accept domains = +local_domains
>            message = $acl_verify_message
>            verify  = recipient/defer_ok
> 
>     deny message = relay not permitted
> 
> begin routers
>     hosta_verify_router:
>         driver = manualroute
>         domains = +local_domains
>         transport = internal_smtp
>         route_list = +local_domains mx.hosta.com
>         verify_only = true
> 
>     # Relay to the GMail MX for gmail_domains
>     hosta_inbound_relay:
>         driver = manualroute
>         domains = +local_domains
>         condition = ${if eq {$acl_m_hosta} {"ok"}}


This I changed to:
        condition = ${if eq {${extract {${tr{$local_part}{=}{_}}@$domain} {$acl_m_hosta}}} {hosta}}

>         transport = internal_smtp
>         route_list = +local_domains mx.hosta.com <http://mx.hosta.com/>
> 
>     route:
>         driver = manualroute
>         domains = +local_domains
>         transport = internal_smtp
>         route_list = +local_domains my-mx.mydomain.tld
> 
> begin transports
>     internal_smtp:
>         driver = smtp
> ```


Thanks!

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/