[Pkg-exim4-users] How to choose a smarthost based on From: address in Exim4

Andreas Metzler ametzler at bebt.de
Mon Apr 3 18:23:40 BST 2023


On 2023-04-02 Faheem Mitha via Pkg-exim4-users <pkg-exim4-users at alioth-lists.debian.net> wrote:
[...]
> My modified version of the solution by Auslander is

>     dc_smarthost='"${if match{${lc:$header_from:}}{.*gmail.com}{smtp.gmail.com::587}{${if match{${lc:$header_from:}}{.*mydomain|.*mailbox.org}{smtp.mailbox.org::587}{secure-email-32.luxsci.com::587}}}}"'
[...]
>     Mar 30 01:59:54 orwell exim4[3626569]: sed: -e expression #1, char 861:
> unknown option to `s'

> I have no idea how to debug this. An explanation of the error would be
> appreciated. A version that works would be even more appreciated.

Hello Faheem,

update-exim4.conf's stumbles over the pipe character in the variable
definition. simply set dc_smarthost to a dummy value (e.g. "overridden")
and directly set the macro
DCsmarthost="${if match ... }"
in /etc/exim4/exim4.conf.localmacros (assuming nonsplit config)

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'



More information about the Pkg-exim4-users mailing list