Exim allow emails to domain same as mail server.


I have a debian etch server, its a web server and im using exim for sending emails. The problem is the domain name e.g. domain.com is on the same IP as our Exchange server.

I have an MX record that points mail.domain.com to the same IP

Sending mails to any external address is working great but sending to domain.com I get

2010-03-24 16:33:19 1NuTWB-0006RA-Nn mail.domain.com [] Connection refused
2010-03-24 16:33:19 1NuTWB-0006RA-Nn == joe@domain.com R=dnslookup_relay_to_domains T=remote_smtp defer (111): Connection refused

Can I allow this relay with Exim?

Thanks, Joe
Who is Participating?
nociConnect With a Mentor Software EngineerCommented:
Ok, that a different issue.
I do known exim/qmail/courier but not exactly exchange....

That needs to be configured in exchange, as well as an allowed domain (allow relaying) and it needs to be routed to your mailer. (An MX on your internal DNS might be sufficient but I'm not sure.
joe90kaneAuthor Commented:
I have setup the A & MX record to point to the internal mail server but I am getting error

all relevant MX records point to non-existent hosts?
nociSoftware EngineerCommented:
Toy need to edit the exim.conf

Find the line with:
domainlist local_domains                - for local deliveries
domainlist relay_to_domains          - for sending through

and add the intended domain. The lists are : (colon) separated.

Alternative it can be a lookup from a database:
domainlist relay_to_domains = lsearch;/etc/exim/mydomains

(or use LDAP , mysql etc.)
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

joe90kaneAuthor Commented:
Thanks I have added the domain to those options but getting

Unrouteable address for the domain?
nociSoftware EngineerCommented:
If you add it to local_domains the part after the @ is broken off and it is tried to use the native local delivery options (to a users .maildir or mail file)
but a user of the right name must exist in a lookup. (getuserbyname()) or if a special delivery has been configured then according to its rules.

if you added it to relay_to_domains then it needs to be able to pass it on to the next mailer.

If you added it to both it's a configuration error (how can an address be both local & remote at the same time)...
joe90kaneAuthor Commented:
Ok I think I understand,

I added it to local_domains but How can I get the email sent through our exchange server on the same network?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.