Sending Emails to External Mail Server, Getting Caught Locally

Hi,

Over the last few days I have spent trying to find an asnwer to my problem. I recently redirected the MX record of a customers email to a new email server, seperate from the server where the domain is, that worked, email sent from say gmail, or hotmail is delivered.

The problem occurs when I try to send email from

a. a domain on the same server where the site is
b. from the website in code

obviosuly those are being delivered locally onto the server, so I went into the DNS settings and changed the mail point to the ip of the external mail server and the MX re3cord to mail.domain.com and then done an nslookup to confirm it was correct - but the mail still goers locally and im running out of time to get it resolved, any help would be much appreciatted.

Kind Regards
Karl
totesisotonerAsked:
Who is Participating?
 
Alan HardistyConnect With a Mentor Co-OwnerCommented:
Same principal applies - the server thinks the domain is hosted locally, so references to it need to be removed from the server.

How you go about that is anyone's guess.  I would talk to Fasthosts and ask their support team as they should be able to help you.
0
 
Alan HardistyCo-OwnerCommented:
Check your Recipient Policies for the domain that is now external and remove the domain name from the Policy - this will tell Exchange to deliver mail externally, not internally.
0
 
sshah254Commented:
The problem lies with your code on the server where the "website" is.

Let's say that your domain is example.com.  Your site is on the server example.com (@1.1.1.1), and the MX records for mail.com are pointed to 2.2.2.2.

When mail is being sent from the site (@1.1.1.1), the code is checking the DNS server for the 'A' record of example.com which is returned as 1.1.1.1 and mail is sent locally.  The code should be checking the DNS server for the 'MX' record of example.com which would be returned as 2.2.2.2 and the mail would go properly.

A couple of ways to fix this:

1.  Set the 'A' record for mail.example.com to 2.2.2.2 and send the mails to user@mail.example.com (instead of user@example.com).
2.  If there are only a few users, then do the mail forwarding from user@example.com to user@mail.example.com - this will vary depending on the mail server you are using.

SS
0
 
totesisotonerAuthor Commented:
Hi,

on the first comment I'm afraid I'm
not using exchange. I'm using what's called Matrix Mail on a Fasthosts server.

On the second I'm afraid, yes that may work using the name@mail.domain.com but it isn't just sending from the site. If I send from domain2.com on the same server it routes locally too.

Any other ideas, sorry.
0
 
totesisotonerAuthor Commented:
In a sense it is as the is hosted, but email isn't. Iv got round it now by deleting the domain and aliasing it onto another which as cleared the DNS

Many thanks for your help guys
0
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.