SMTP Relay through exchange.
I have a asp.Net application the uses system.web.mail to relay message to an exhange server with one NIC (xxx.xxx.xxx.103). The asp.Net app is running on a server with two NICs each with a single IP. xxx.xxx.xxx.20 and xxx.xxx.xxx.21, this is necessary because we are hosting 2 websites that need SSL. When the myMail.send(mymessage) is fired, the message seems to be relayed through whatever NIC is free at that time. The problem is .21 doesn't allow for outbound mail. Any email address that is within the organization is okbut if it sends the relay through .21 andits outboundI get this exception:System.Web.HttpException: The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for xyz@gmail.comI've searched around and ran into a few articles and my exhange admin tells me he's added .21 to the RelayRestrictions list and granted permission:http://technet.microsoft.com/en-us/library/dd277329.aspxThis problem doesn't occur when relaying through the NIC with ip of 20. ( I know because I can physically unhook the cat5s and the relays are forced to go through on 1 Nic over the other)Is there any other configuration in Exchange 2003 that needs to be set to allow for a certain IP to send outbound e-mail?Here's some details:Running IIS 6, Server 2003 r1, .Net 2.0 <application machine.Exchange 2003, Server 2003 r1 In the code the myMessage.fromis always the same accountI do not authenticate (I don't need to for 20, so why should I for 21?)Also, this may be out of the scope of this forum but is there a way in code to actually force a relay through a specific IP? I understand this may have to do with port pooling and I've disabled smtp port pooling, though that seems to only work for the virtual smtp server which the code is running on and does not seem to affect the relayed message.Thanks
July 22nd, 2009 12:45am

Windows doesnt select the source IP based on "whatever NIC is free at that time". It selects it based on "proximity" to thedestination. See Here for detail on that:http://blogs.technet.com/networking/archive/2009/04/24/source-ip-address-selection-on-a-multi-homed-windows-computer.aspxAre you suggesting the IP selection is .20 at times and .21 at others? I would think we need to identify what is the catalyst for this choice. Mike Crowley A+, Network+, Security+, MCT, MCSE, MCTS, MCITP: Enterprise Administrator / Messaging Administrator
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2009 1:24am

Thanks for replying. I suppose it sends through .21 because in hardware its the lower devices number, or the 1st NIC. However, I do want the exchange server to respond to the either IPthe same way. I don't understand why one IP gets to relay outbound mail and the other doesn't. How does exchange determine this?
July 22nd, 2009 6:09pm

Exchange 2003 uses a "virtual smtp server" to send smtp mail. within contains configuration of IP addresses that are allowed to relay without authentication. It sounds like .20 is in this list but .21 is not. You could add both of them to the list as a workaround for this problem. Mike Crowley A+, Network+, Security+, MCT, MCSE, MCTS, MCITP: Enterprise Administrator / Messaging Administrator
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2009 9:07pm

Thanks I'll ask the exchange admin tomorrow. I'm not too familiar with Exchange server, but if its anything like IIS, it'd be in IIS > Default SMTP virtual server > properties > access > Relay. Incidentally, would there be two exclusive settings, one in exhange and another in the defualt smtp virtual server in IIS on that machine? He mantioned yesterday he did this ttp://technet.microsoft.com/en-us/library/dd277329.aspx which sounds like what you suggested above, unless there are two settings and he's missed changing one of them.Also, I've configured the smtp virtual server on the machine that runs the code, but I assume that's if myMail.SmtpServer = "ip of the .net machine" was what I had in the code and not when I'm sending to the exchange server.
July 23rd, 2009 12:48am

How about using authentication when submitting mail to Exchange, then you dont have to worry about which IP you application have.By default with authenticated SMTP sessions,you get the permission to relay regardless of IP.lasse at humandata dot se, http://anewmessagehasarrived.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2009 11:58am

Hi Joel, We should configure relay setting by using Exchange System Manager tool. It is because that the DS2MB service (run as part of the System Attendant process) will replicate Virtual Server settings from AD to the MetaBase. Please understand that DS2MB only replicates one way (from AD to the Metabase) and AD settings always overwrites the Metabase.Mike
July 24th, 2009 1:26pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics