All this was working fine, except for the following. As an anti-spam measure gmx (and probably other email providers) check whether the email originates from the system that is specified in the From address. For some of my family members this is obviously not the case: They have a web.de email account but their outgoing email never sees an web.de server (because it is relayed via my DSL provider). Gmx therefore classifies all our Emails as spam, which we are not particularly happy about.
I need to relay the email of web.de users via web.de and the email of other users via other systems!
In the following I assume an "unsplit configuration" of exim4 (I answered NO to the relevant question of "dpkg-reconfigure exim4-config"). If you use a split configuration you have to modify a different file, probably /etc/exim4/conf.d/main/01_exim4-config_listmacrosdefs.
#for satellite and smarthost-systems .ifndef DCsmarthost DCsmarthost = DEBCONFsmarthostDEBCONF .endifand change them into
#for satellite and smarthost-systems .ifndef DCsmarthost DCdefault_sh = DEBCONFsmarthostDEBCONF DCsmarthost = ${lookup{$sender_address}lsearch{CONFDIR/smarthost_per_user}{$value}{DCdefault_sh}} .endif
# debconf-driven macro definitions get inserted after this line UPEX4CmacrosUPEX4C = 1insert
# Fix to use user specific smarthosts. Save the configured smarthost # in DCdefault_sh and do a lookup for DCsmarthost. DCdefault_sh = DCsmarthost DCsmarthost == ${lookup{$sender_address}lsearch{CONFDIR/smarthost_per_user}{$value}{DCdefault_sh}}Here we save the configured value of DCsmarthost in DCdefault_sh and overwrite DCsmarthost afterwards.
The file smarthost_per_user looks as follows:
xxx@yy.zz: smarthost.xx.zz yyy@web.de: smtp.web.de::587[Somebody seems to block me from connecting to the default smtp port 25 at web.de, therefore I use port 587.]
To use this new exim configuration go through dpkg-reconfigure exim4-config or do
update-exim4.conf; /etc/init.d/exim4 restart
In contrast to my DSL provider the smtp server of web.de requires some authentication. I set this up in /etc/exim4/passwd.client.