Re: [exim] route mail to remote host

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Dennis Davis
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] route mail to remote host
On Mon, 30 Jun 2014, Graeme Fowler wrote:

> From: Graeme Fowler <graeme@???>
> To: exim-users@???
> Date: Mon, 30 Jun 2014 14:16:02
> Subject: Re: [exim] route mail to remote host
>
> On Mon, 2014-06-30 at 13:40 +0100, Jason Cornell wrote:
> > I am probably missing something but from what I have read so far
> > it is not 100% clear.
>
> When the message arrives, set an ACL variable for that message
> based on the logic you need - you may need one in both the SMTP
> and non-SMTP ACLs for completeness, and you may need to do the
> check after DATA if you want to filter on message body, additional
> inbound headers and so on.
>
> Then in the router make it trigger conditionally on the value
> stored in (or the existence of) that ACL variable.
>
> Example:
>
> acl_smtp_rcpt:
>   <some stuff>
>   warn set acl_m_specialroute = "specialroute"
>        condition = ${if eq{$local_part}{fred}}

>
> and in the router:
>
> specialroute:
> driver = manualroute
> domains = +local_domains
> transport = specialroute
> route_list = * my.special.mailhost
> condition = ${if eq{$acl_m_specialroute}{specialroute}}
>
> NOTE: all hypothetical, untested, might eat your first born etc.


Probably won't work for multiple recipients. From the manual,
Chapter 11 - String Expansions:

$local_part
When an address is being routed, or delivered on its own, this
variable contains the local part. When a number of addresses are
being delivered together (for example, multiple RCPT commands in
an SMTP session), $local_part is not set.
--
Dennis Davis <dennisdavis@???>