Re: [exim] retry time and fallback host

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Mike Cardwell
Date:  
À: Exim Users List
Sujet: Re: [exim] retry time and fallback host
Zbigniew Szalbot wrote:

>>> Is it possible to configure exim so that once certain rerty time passes
>>> (say 24h), when attempting to send queued emails exim will switch to
>> pass
>>> them to a smarthost instead of trying to deliver them straight to the
>> end
>>> recipients?
>> In your dnslookup router stick this condition:
>>
>> condition = ${if <{$message_age}{86400}}
> Shouldn't there be > here?


No, because I specified to put the smarthost router afterwards. Which
means, whilst it's been on the queue for less than 1 day run the
dnslookup router, otherwise continue onto the next router which is the
smarthost one.

>> And then stick a smarthost router after it.
>
> OK. So just to make sure:
> dnslookup:
> driver = dnslookup
> domains = ! +local_domains
> condition = ${if <{$message_age}{86400}}
> transport = remote_smtp
> condition = ${if >{$message_age}{86400}}
> transport = smarthost
> ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
> no_more
>
> Or how do I put "else" condition here?


You need two separate routers, only one transport can be referenced in a
router, and you can only use "condition" once per router. Order is
important:

dnslookup:
   driver              = dnslookup
   domains             = ! +local_domains
   condition           = ${if <{$message_age}{86400}}
   transport           = remote_smtp
   ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
   no_more


smarthost:
   driver              = manualroute
   domains             = ! +local_domains
   transport           = remote_smtp
   route_list          = * "192.168.0.1"
   no_verify


This assumes that the smarthost is at 192.168.0.1. Change the IP
accordingly.

Mike