Link to home
Start Free TrialLog in
Avatar of rmariotti
rmariotti

asked on

Multiple Exchange SMTP Domains - 550 5.7.1 Unable to relay

I am trying to do something rather simple, but after several days of trying all kinds of configurations, I still cannot do what I need to do.  Here is the situation:

I have Exchange 2003 (on Small Business Server 2003) which currently services SMTP "domain123" for 10 users.  A related website, with domain "domain789" is to be moved to this Exchange server from a hosted solution.  Exchange has the ability to do this, in fact this article pretty clearly lays it out: http://www.msexchange.org/tutorials/MF010.html.  Following this article, I added domain789 to the Default Recipient Policy.  Additionally, I have setup the correct MX mail exchange and A DNS public records.  I know these are not the problem since the emails get bounced back from the correct IP address.  

Seemingly no matter what I try, I cannot get mail to be accepted from an outside server (I can send mail internally using another Exchange account).  Below is the NDR result.  So you can see that it is finding my Exchange server (12.99.126.100), but Exchange won't relay.  

I've tried:
     * Adding the additional domain to a new Recipient Policy, instead of the Default Policy
     * Adding the domain as *.domain789.com to ESM "Internet Message Formats"
     * Adding an SMTP connector for address space domain789, checking "Allow messages to be relayed to these domains"

The only way I can get the messages through to my domain is to clear the "Relay Restrictions" on the Default SMTP Virtual Server in ESM.  To prevent my Exchange server from acting as an open relay to the outside world, I had these settings:  "Only the list below:  [internal domain range], 127.0.0.1", and "Allow all computers to successfully authenticate regardless of the list above".  What I don't understand is how my existing domain (domain123) is able to accept mail from all outside mail servers without any issue.

How can I support this additional domain while securing my Exchange server from being an open relay?

Thanks for your assistance!

----------------------------------
Hi. This is the qmail-send program at yahoo.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<custserv@domain789.com>:
12.99.126.100 does not like recipient.
Remote host said: 550 5.7.1 Unable to relay for custserv@domain789.com
Giving up on 12.99.126.100.

--- Below this line is a copy of the message.

Return-Path: <sender@yahoo.com>
Received: (qmail 2437 invoked by uid 60001); 6 Jan 2006 00:46:44 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding;
  b=setlanO57YsBOfONE4IgtmTpNYURff2CVKQ+LynGIT5XOQdU9JVkwENEuM+EJUHpRdxgueHs7L26wjLl0h9geXmhxmjZZ9AyRkiNGyJDaKG7gKhQHOFBFiYLUgpUPDvml6by7KO2pmJ9ruhH9ZxRiMPgl9dXT3MEK5vwJkOUiTw=  ;
Message-ID: <20060106004644.2435.qmail@web36214.mail.mud.yahoo.com>
Received: from [12.99.126.16] by web36214.mail.mud.yahoo.com via HTTP; Thu, 05 Jan 2006 16:46:44 PST
Date: Thu, 5 Jan 2006 16:46:44 -0800 (PST)
From: Sender<sender@yahoo.com>
Subject: From Yahoo Mail Web 0448
To: custserv@domain789.com
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Body of message...
----------------------------------
SOLUTION
Avatar of NetoMeter Screencasts
NetoMeter Screencasts
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rmariotti
rmariotti

ASKER

Thanks for the comment, NetoMeter, but as I mentioned in my post, I've already tried what appears to be the basic steps of simply adding the new domain to my recipient policy...to no avail.  

I will, however, do some telnet-based testing to see if I get similar results and update the post.

Judging by the fact that I'm able to send once I take the relay restrictions off of the Default SMTP Virtual Server, I have a feeling that this is where my problems are--but I'm not sure what the correct settings should be!

Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sembee,

Do I need any SMTP connectors?  I believe that Small Business Server, or maybe the default Windows Server 2003 installation added an SMTP server with the following properties:

Name: Internet Mail SMTP Connector (<SERVERNAME>)
Address Space: * (unchecked: Allow messages to be relayed to these domains)
Connector Scope: Entire organization

When I came back to my computer this morning, after removing the relay restrictions from my Default Virtual SMTP Server, I must have misconfigured to be a relay as I had several NDRs from foreign addresses to outside (yahoo, etc) addresses.  I've since deleted all messages in the queue and restarted the SMTP service, along with deleting the SMTP connector I added last night for domain789.  I'll monitor my queue to make sure I'm not relaying.  

So my questions now are:

1) Do I need ANY SMTP connectors or is is safe to remove the one described above?  It is my understanding that they're only useful for overriding SMTP settings for specific domains, which I don't have any requirements.

2) What are the correct settings for the Default SMTP Virtual Server, both in the Authentication and Relay sections.  Right now, I have "Anonymous", "Basic authentication" and "Integrated Windows Authentication", per http://www.msexchange.org/tutorials/MF005.html.

3) Are there resources to test setting to see if my server is an open relay?  I'm going to try to test using telnet, but this is a bit out of my experience range...

Thanks for your input, almost there!
Just a quick update: I have now tested my server for open relay, and all looks okay.  On my Default Virtual SMTP server, I had "All exept the list below" instead of "Only the list below" selected.  I have removed this, and, using telnet, seem to get the correct response for outside domains.  HOWEVER, my domain789 still is not recognized.  See below:

220 domain123.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830
ready at  Fri, 6 Jan 2006 08:57:01 -0800
helo mail.domain123.com
250 domain123.com Hello [12.99.126.16]
mail from: spammer@spam.com
250 2.1.0 spammer@spam.com....Sender OK
rcpt to: rmariotti@domain123.com
250 2.1.5 rmariotti@domain123.com
rcpt to: rmariotti@domain789.com
550 5.7.1 Unable to relay for rmariotti@domain789.com

So you can see that I'm still not able to send to domain789.  To answer Sembee's question, I set up the Recipient policy by:

* Double click "Default Policy", go to "E-mail Addresses (Policy)" tab.
* New..., double click "SMTP Address"
* Add new address: "@domain789.com", leave checked: "This Exchange Organization is responsible for all mail delivery to this address."
* OK, OK to apply this email to existing accounts (username@domain789.com is in each user's AD e-mail list)
* Right-click, choose "Apply this policy now..."


The SBS installation creates the connector.
What you don't need is the connector configured for those domains. An SMTP Connector is for OUTBOUND email only. It plays no part in inbound email.

I now put SMTP Connectors on all installations that I build. If you are on a DSL connection then you may have problems delivering email to certain domains.

The settings for authentication look fine. Relay settings depend on whether you will have external users sending email through your server. If you have that requirement then you need to look at the security settings carefully to ensure that you aren't an open relay.

I don't tend to trust the online resources as they are usually run by the same people who operate the blacklists.
Telnet test isn't too difficult, it is just a matter of putting the right commands in the right place.
http://www.amset.info/exchange/telnet-test.asp

Simon.
I have no need for external users sending email through my SMTP server.  Also, please note my post above, looks like I posted it while you were composing...just didn't want those comments to be lost...

Thanks!
In my testing, I found a situation where I can properly send email from an outside user to the second, domain789 domain:

If I set "@domain789" as the PRIMARY address in the Recipient Policy:
   * Mail for the domain789 actually was relayed correctly.
   * Mail for the NON-PRIMARY domain123 was also relayed correctly.

Obviously, my issue is not fixed, as user replies now default to the incorrect user@domain789.com.  I thought it was interesting that the non-primary domain was also relayed.  Maybe there's something special about the domain123 that was specified upon install of SBS2003.  

Also of note: the ISA Server SMTP Application Filter is not enabled and contains no settings.

argh...
The domain that matches your main network domain or was specified during the setup of Exchange shouldn't be removed.
Try putting an additional policy in place.
Also make sure that you have enabled the policy - having the email address listed is not enough - it has to be ticked to work.

Simon.
I have been verifying throughout my testing that the new domain is always checked.  I have tried adding the new domain as an additional Recipient Policy in the past, but I went ahead and tried it again, still the same relay denied.  My new Recipient policy has the following properties:

SECOND DOMAIN POLICY (Priority = 1)
Filter rules: (none)
E-Mail Addresses (Policy):
  - (checked) SMTP       @domain789.com  >> PRIMARY
  - (checked) X400        c=us;a= ;p=CFS;o=Exchange;  >> PRIMARY

The Default policy looks like this: (Priory = Lowest)
Filter rules: (mailnickname=*)
E-Mail Addresses (Policy):
  - (checked) SMTP       @cfs.local
  - (checked) SMTP       @domain789.com
  - (checked) SMTP       @domain123.com  >> PRIMARY
  - (checked) X400        c=us;a= ;p=CFS;o=Exchange;  >> PRIMARY

Hope this provides some clues!

I've attached the NDS for reference below



=======================================
Hi. This is the qmail-send program at yahoo.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<rmariotti@domain789.com>:
12.99.126.100 does not like recipient.
Remote host said: 550 5.7.1 Unable to relay for rmariotti@domain789.com
Giving up on 12.99.126.100.

<custserv@domain789.com>:
12.99.126.100 does not like recipient.
Remote host said: 550 5.7.1 Unable to relay for custserv@domain789.com
Giving up on 12.99.126.100.

--- Below this line is a copy of the message.

Return-Path: <sender@yahoo.com>
Received: (qmail 94955 invoked from network); 6 Jan 2006 23:21:21 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=Received:From:To:Cc:Subject:Date:MIME-Version:Content-Type:X-Mailer:Thread-Index:X-MimeOLE;
  b=RSQ+y34/lEtkBrjuMpKexcJZuLdcBv0ZDs8Khb6Zy0H4aSu+c0UJihRvv/nBtmsGExBKczgHJ8WmEHh6WPTkMiP7zVAL/8AZOzTNoQc8hE6vwxd8kGxd6kECXEEHQHc/LSCXUbb5bYMQiRWmL7eD46iVG7rXZ4b9sdmoUgdpmrw=  ;
Received: from unknown (HELO cfswrkst1) (sender@12.99.126.100 with login)
  by smtp100.mail.sc5.yahoo.com with SMTP; 6 Jan 2006 23:21:20 -0000
From: <sender@yahoo.com>
To: <custserv@domain789.com>
Cc: <rmariotti@domain789.com>
Subject: Testing with additional recipient policy, no filter
Date: Fri, 6 Jan 2006 15:22:54 -0800
MIME-Version: 1.0
Content-Type: multipart/alternative;
      boundary="----=_NextPart_000_0000_01C612D5.129F4680"
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
Thread-Index: AcYSRj+TXuDWCoRTSFyv9J2p7oPf1w==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C612D5.129F4680
Content-Type: text/plain;
      charset="us-ascii"
Content-Transfer-Encoding: 7bit

Testing with additional recipient policy, no filter

------=_NextPart_000_0000_01C612D5.129F4680
Content-Type: text/html;
      charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR></HEAD> <BODY> <DIV><FONT face=3DArial size=3D2>Testing with additional recipient = policy, no=20 filter</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>Testing with additional recipient = policy, no=20 filter</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>Testing with additional recipient = policy, no=20 filter</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT></DIV></BODY></HTML>

------=_NextPart_000_0000_01C612D5.129F4680--
Hi!
What happened, Rmariotti?
I am sorry, but I couldn't follow the discussion for a couple of days.

NetoMeter
Forum,

To answer NetoMeter's question, I'm at the same place that I started: still unable to receive email for my additional domain (domain789.com).  I have tried the various changes noted above to the Recipient Policy with no luck.  Most recently, I turned on logging for ALL services to "Maximum" then tried sending mail externally to domain789.com to see what errors are produced.  Nothing surprising, just a 7010 error logged, telling me exactly what prior NDRs have told me all along.  I have pasted the error below for reference.

****
Source: MSExchangeTransport
Category: SMTP Protocol
Type: Error
Event ID: 7010
This is an SMTP protocol log for virtual server ID 1, connection #1. The client at "216.136.174.138" sent a "rcpt" command, and the SMTP server responded with "550 5.7.1 Unable to relay for custserv@childrenschoiceonline.com  ". The full command sent was "rcpt TO:<custserv@childrenschoiceonline.com>".  This will probably cause the connection to fail.
****



Also of note: in an earlier post, Simon noted that I didn't need local IP addresses in the relay section of my Default Virtual SMTP Server (such as 127.0.0.1 or 192.168.16.2), which was fully correct with the info given.  What I failed to mention was that a .NET application is run on the SBS2003/Exchange2003 server which uses a CDO object to send emails.  When I removed the local IP addresses, application-sent emails were rejected as relaying, which is probably correct (application error below).  So I have added back those internal IP addresses so my application can send/relay emails to external addresses.  

****
The following InnerException reported: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8004020F): The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for user@outsidedomain.com
****

Thank you Sembee and NetoMeter for your help thus far...any further suggestions that would help me diagnose why I can't relay to this internal domain?  
Cheers,
Ryan
As this issue has not been able to be solved using traditional steps/methods, I have augmented the point value to 500 points.

Ryan
I have finally solved this issue after a week of dead-ends, so I wanted to make sure to post my solution so others with this issue might find a similar fix.

The issue was that the Directory service to metabase service (DS2MB) wasn't able to update the metabase with the new Recipient Policy (or any SMTP changes, for that matter).  I found this after upping the diagnostic logging on ALL services.  I found Event ID 1040 for source MSExchangeMU, and proceeded to debug.  I started looking for "Metabase 5.7.1" in Google Groups and came up with:

http://groups.google.com/group/microsoft.public.windows.server.sbs/browse_thread/thread/15e831409481765a/8af1d59e381aaa1d?lnk=st&q=5.7.1+metabase&rnum=2&utoken=axmcE0YAAACAT_kPml7nPanGq5_khmjXgP-tS31hakRaUqJOki041qG2zFZkc34ScLXYq7vPwUPqy7LpN0kInhmnPrax4xrQTloHJX-orWmzzl4LCDoLUA

The Microsoft tech's (Nathan) suggestion to delete specific keys then have the Microsoft Exchange System Attendant rebuild the metabase upon restarting the service worked.

Thank you very much for your help!


Step-by-step Fix:
http://www.eventid.net/display.asp?eventid=1040&eventno=3972&source=MSExchangeMU&phase=1 (see Error code 80070003)

An explanation of the DS2MB service is explained here:
http://www.microsoft.com/technet/prodtechnol/exchange/guides/E2k3TransnRouting/1b311041-2443-472b-8e9f-e26b2090ba78.mspx
 
Hi Rmarioti,

It’s good that you’ve been able to solve the problem. I guess you've recreated the DS2MB key this way:

[DISCLAIMER: the link below refers to a site requiring a paid registration to view. modguy, Experts Exchange moderator]
http://www.netometer.net/samples/metabase/step1.html

Nice!

NetoMeter
Netometer,

My eventual solution was indeed similar to the link you provided above.  Just so others know, I needed to delete the "SMTPSVC/1/domain" key structure in addition to the DS2MB key.  After deleting the domain key, the MSExchangeMU 1040 stopped, the System Attendant recreated the correct structures, and all was right with the world.  Thanks again, Netometer and Sembee for your suggestions...

Ryan
Thanks to Simon and NetoMeter.  Since I eventually solved this myself (repairing various parts of the DS2MB key/domain key in the metabase), I reduced the points.  Additionally, I awarded Simon the lion share of points due to his specific instructions/suggestions.

Thanks again