Sending Emails to External Mail Server, Getting Caught Locally

Posted on 2011-10-08
Last Modified: 2012-05-12

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 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
Question by:totesisotoner
    LVL 76

    Expert Comment

    by:Alan Hardisty
    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.
    LVL 9

    Expert Comment

    The problem lies with your code on the server where the "website" is.

    Let's say that your domain is  Your site is on the server (@, and the MX records for are pointed to

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

    A couple of ways to fix this:

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


    Author Comment


    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 but it isn't just sending from the site. If I send from on the same server it routes locally too.

    Any other ideas, sorry.
    LVL 76

    Accepted Solution

    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.

    Author Comment

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    One of the most often confused topics in the area DNS is the idea of GLUE records. Specifically, what they are, when they are needed, when they are provided, and how they are created. First, WHAT IS GLUE? To understand GLUE, you must first under…
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now