[Exim] exim4 on a mobile environment

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Mattia Dongili
Date:  
À: exim-users
Sujet: [Exim] exim4 on a mobile environment
[please Cc: me as I'm not subscribed to the list]

Hello *,

I'm trying to configure exim4 (4.2.22 on debian) to use different
smarthosts based on different network environment, only 2 at the moment.

The problem I encountered is I'm triyng to use conditionals to provide
the smarthost and port settings to exim.

I defined the macros (tested and working with exim4 -be)

DCsmarthost = ${if exists {/etc/exim4/work-env}{smtp.work.it}{smtp.home.it}}
MYport = ${if exists{/etc/exim4/work-env}{8025}{25}}

and

remote_smtp:
debug_print = "T: remote_smtp for $local_part@$domain"
driver = smtp
port = MYport

and

smarthost:
driver = manualroute
domains = ! +local_domains
transport = remote_smtp
route_list = * DCsmarthost

host_find_failed = defer
same_domain_copy_routing = yes
no_more

but running *exim4 -qf -v* I have:

LOG: queue_run MAIN
Start queue run: pid=1709 -qf
LOG: MAIN
== m.dongili@??? R=smarthost defer (-1): smarthost router: failed to expand "${if": condition name expected, but found ""
LOG: queue_run MAIN
End queue run: pid=1709 -qf

or

LOG: queue_run MAIN
Start queue run: pid=1861 -qf
T: remote_smtp for m.dongili@???
LOG: MAIN PANIC
== m.dongili@??? R=smarthost T=remote_smtp defer (-1): TCP port "${if exists{/etc/exim4/work-env}{8025}{25}}" is not defined for remote_smtp transport
LOG: queue_run MAIN
End queue run: pid=1861 -qf

I'm clueless... I tried enclosing the 2 conditions between "" and not
using macros but the result doesn't change

any ideea?

thanks
--
mattia
:wq!