501 error trying to send external mail

I've spent the last few days migrating off of Exchange 2003 to 2007 and shutting down the 2003 server. But now I'm having problems with sending email outbound.

I have a send connector, * is the name space and I have my smarthost configured (same way that worked with Ex2003) and I have the response setup to my external mail server's name. So, I have mydomain.local internally, but have mydomain.com externally. The external mail server's name is mail.mydomain.com and that's what's in the response page of the send connector - just like I had in 2003.

However, I don't even think emails are getting that far. Everytime I try to send an email externally, it fails nearly immediately and I get this message:

The following organization rejected your message: home.

followed by 'diagnostic information'

home #501 Your domain does not seem to be valid. Could not find MX record for your domain. ##

I have no clue what 'home' is on my network.

Anyway, I am at wit's end on this - any help would be greatly appreciated.  This was the same setup that worked fine before.

Who is Participating?
don_caruanaConnect With a Mentor Author Commented:
Looks like I answered my own question, but I'll post what I ended up doing here for others.

I made sure all the tracing I could turn on was turned on, including the connectivity log (which needs to be done in the shell : set-transportserver -identity <server> -ConnectivityLogEnabled $true).

Looking there (C:\Program Files\Microsoft\Exchange Server\TransportRoles\Logs\Connectivity, by default), I could see that the messages were getting to my external mail server (my smarthost). Looking over at the message tracking log (C:\Program Files\Microsoft\Exchange Server\TransportRoles\Logs\MessageTracking), I saw that my smarthost was actually rejecting my e-mails because the reply-to address was set to my local domain! (me@mydomain.local, vs me@mydomain.com).

There are two ways to do this, depending on your organization.

You can go to each individual mail box and set the reply to address to your external domain name. But in order to do this, you need to uncheck "Automatically update e-mail addresses based on recipient policy". But there's an easier way to do it, but it's complicated to.

FIrst, you have to set up an accepted domain that matches your external domain (mydomain.com). I already had one that was mydomain.local. The key here is that you have to say it's an internal relay domain (even though the option says that's for another AD in the forest). Once you've done that, do to the email address policies.

The trick in email address policies is that little dropdow arrow next to 'Add'. That allows you to create a custom address. Once you get in there you can use an 'alias'. The parameters are:
%g - Used for given name (first name); %i - Used for middle initial; %s - Used for surname (last name); %d - Used for display name; %m - Used for Exchange alias; %xs - Uses the x number of letters of the surname. For example if x=2, then the first two letters of the surname are used.; %xg - Uses the x number of letters of the given name. For example, if x=2, then the first two letters of the given name are used.
Anyway, type in the alias - in my case it's %m@mydomain.com, set that as your reply and apply the policy and voila!! Problem solved.
Firewall? Something doing SMTP scanning?
You said that you are using a smart host. What is the smart host? Another server on your network? A firewall, ISP?

Something is issuing that name, and it isn't an Exchange server.

don_caruanaAuthor Commented:
I followed the other thread, but DNS, nslookp, all that is working fine. Additionally, I don't think a firewall is doing this (although it's possible). I was actually able to send email to Gmail when I set up an MX-based connector (but nothing else).

The smarthost is my external mail server as above (mail.mydomain.com) at my external domain host.
Closed, 125 points refunded.
EE Moderator
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.