I have a server which is reachable under the domain mydomain.com. The mailserver for this domain (sending and receiving) is mail.provider.com. As I have to send a newsletter from my site and the provider doesn't allow to use his mailserver for newsletters, the provider authorized my server to send mails (SPF entry).
So I configured Exim4 to accept connections only from localhost. To get a correct "EHLO mydomain.com" I have to change /etc/hosts and /etc/hostname so that my server has the hostname mydomain.com
With this configuration I can send mails to all big mail providers without problems. However, I'm not able to send mails from the server to any @mydomain.com addresses.
Mainlog says:
2011-09-10 16:33:41 1R2Ocn-0001Ba-QD <= [email protected] U=user P=local S=991
2011-09-10 16:33:41 1R2Ocn-0001Ba-QD ** [email protected]: Unrouteable address
2011-09-10 16:33:41 1R2Ocn-0001Bc-Qr <= <> R=1R2Ocn-0001Ba-QD U=Debian-exim P=local S=1758
2011-09-10 16:33:41 1R2Ocn-0001Bc-Qr ** [email protected]: Unrouteable address
2011-09-10 16:33:41 1R2Ocn-0001Bc-Qr Frozen (delivery error message)
2011-09-10 16:33:41 1R2Ocn-0001Ba-QD Completed
So changing /etc/hosts and /etc/hostname seems not to be the right solution here.
I think best solution would be to hardcode the EHLO data in /etc/exim4/exim4.conf.template Tried this already with the following lines:
REMOTE_SMTP_HELO_DATA=mydomain.com
=> "EHLO vadmin123" instead of "EHLO mydomain.com"
PRIMARY_HOST_NAME = mydomain.com
MAIN_HARDCODE_PRIMARY_HOSTNAME = mydomain.com
=> "EHLO vadmin123" instead of "EHLO mydomain.com"
What did I miss?