We have a VPS that hosts a website example.org. Exim is configured to work as a smarthost. All emails sent through exim are successfully relayed to another mail server (that is working on example.com).
To forward mail sent to *@example.org to *@example.com, i.e. change the recipient's address from *@example.org to *@example.com.
If I send email to address *@example.org, then it seems exim doesn't change the address, it still relays the message to another mail server but recipient is still *@example.org. Maybe the redirect is not applied for some reason.
Configuration and logs:
/etc/exim4/conf.d/router/999_exim4-config_redirect (created by me):
domain_redirect: debug_print = "R: forward for $local_part@$domain" driver = redirect domains = example.org data = firstname.lastname@example.org
(for now data is set to a specific address for simplicity and testing)
exim log when sending email to email@example.com (should be redirected to firstname.lastname@example.org):
2012-03-20 19:40:07 1SA4ud-0005Dw-7k <= email@example.com U=www-data P=local S=657 2012-03-20 19:40:08 1SA4ud-0005Dw-7k => firstname.lastname@example.org R=smarthost T=remote_smtp_smarthost H=domain2.com [22.214.171.124] X=TLS1.0:RSA_AES_256_CBC_SHA1:32 DN="C=US,126.96.36.199=#13053737303932,ST=TX,L=Houston,STREET=Suite 400,STREET=11251 Northwest Freeway,O=HostGator.com,OU=HostGator.com,OU=Comodo PremiumSSL Wildcard,CN=*.hostgator.com" 2012-03-20 19:40:08 1SA4ud-0005Dw-7k Completed
So, the address is not changed :(
Please help! I'm trying to make it work for half a day already :(
So, aseq helped me to solve the problem. Although the solution looked a little bit weird to me. When I tried to set dc_use_split_config='true' it didn't help, it looked like my redirect file was not used. Also when I tried to add those redirect lines to the end of /etc/exim4/exim4.conf.template it didn't help either. But when I tried to paste those lines after "begin routers" line it finally worked!