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 <= info@mydomain.com U=user P=local S=991
2011-09-10 16:33:41 1R2Ocn-0001Ba-QD ** test@mydomain.com: 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 ** info@mydomain.com: 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?

link|improve this question
So problem solved, right? – mailq Sep 10 '11 at 16:16
Yes. Is there any way to mark this questione as solved? – patrick Sep 11 '11 at 17:22
Convert your above edit into an answer and then accept your own answer. – mailq Sep 11 '11 at 21:35
feedback

1 Answer

up vote 0 down vote accepted

I don't understand why, but when I change

remote_smtp:
  debug_print = "T: remote_smtp for $local_part@$domain"
  driver = smtp
  .ifdef REMOTE_SMTP_HOSTS_AVOID_TLS
    hosts_avoid_tls = REMOTE_SMTP_HOSTS_AVOID_TLS
  .endif
  .ifdef REMOTE_SMTP_HEADERS_REWRITE
    headers_rewrite = REMOTE_SMTP_HEADERS_REWRITE
  .endif
  .ifdef REMOTE_SMTP_RETURN_PATH
    return_path = REMOTE_SMTP_RETURN_PATH
  .endif
  .ifdef REMOTE_SMTP_HELO_FROM_DNS
    helo_data = mydomain.ocm
  .endif

to

remote_smtp:
  debug_print = "T: remote_smtp for $local_part@$domain"
  driver = smtp
  .ifdef REMOTE_SMTP_HOSTS_AVOID_TLS
    hosts_avoid_tls = REMOTE_SMTP_HOSTS_AVOID_TLS
  .endif
  .ifdef REMOTE_SMTP_HEADERS_REWRITE
    headers_rewrite = REMOTE_SMTP_HEADERS_REWRITE
  .endif
  .ifdef REMOTE_SMTP_RETURN_PATH
    return_path = REMOTE_SMTP_RETURN_PATH
  .endif
  .ifdef REMOTE_SMTP_HELO_FROM_DNS
    helo_data = mydomain.ocm
  .endif
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.