Solved

Troubleshooting database mail (SMTP relay issue?)

Posted on 2007-11-14
9
4,505 Views
Last Modified: 2013-12-25
When trying to use database mail, I get an error whenever I send test mail outside the domain of the originating address. The error is: The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2007-11-14T08:57:20). Exception Message: Cannot send mails to mail server. (Transaction failed. The server response was: 5.7.1 <xxx@yyy.net>: Relay access denied).

The database server is outside the ISP. The mail is configured with a sender address from a domain hosted by the ISP, and a reply-to outside the domain.

When I send a test e-mail, it succeeds for destinations with the same domain as the sender; it fails for e-mail in all other domains tested.

My ISP has specifically white-listed the database server IP for SMTP relaying.

Any suggestions as to how to resolve this issue?
0
Comment
Question by:Jeff Certain
  • 5
  • 4
9 Comments
 
LVL 31

Expert Comment

by:rid
ID: 20281025
Might be the receiving end server that has objections. Do you have a reverse DNS lookup that works for this mail server? Does it say HELO properly?
/RID
0
 
LVL 24

Author Comment

by:Jeff Certain
ID: 20281288
Reverse DNS for the receiving mail server or the sender? And how would I check if it says HELO?
0
 
LVL 31

Expert Comment

by:rid
ID: 20281364
Reverse DNS for your server, the sending. Most servers check this for incoming mail, some reject out of hand if not correct.

The SMTP dialogue begins with a HELO command. The initiator should say something like: "helo mail.domain.com" and the name should correspond to DNS entries. If not correct in syntax or content, the session may be terminated by some servers.
/RID
0
 
LVL 24

Author Comment

by:Jeff Certain
ID: 20281404
I know the IP for the sender. This is the IP address that the ISP owning the mail server has explicitly white-listed for SMTP relay.

To clarify, are you saying that the receiving mail server may also check this, and bounce mail if the originating IP is not the same as the SMTP mail server domain DNS entry?
0
Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

 
LVL 31

Expert Comment

by:rid
ID: 20284480
Yes. Receiving end server may check that the IP has a domain name associated with it and that it is the correct one. A failure in this check will often cause a server to reject incoming message. (for good reasons, I may add... It's a SPAM prevention method).
/RID
0
 
LVL 24

Author Comment

by:Jeff Certain
ID: 20284506
So, it sounds like it's really in my best interest to ensure that the SQL database appears to have the same IP as the mail server... ?

Would this failure appear as "relay access denied" in Database Mail for SQL2005? It seems like that kind of error would occur before delivery... somewhere at the relaying server.
0
 
LVL 31

Expert Comment

by:rid
ID: 20287612
Hmm, I may not have been understanding the problem properly.

Is the origin of the mail this database server? Is it sitting outside your domain?
Does the DB server try to send mail via your mail server to an outside address and that operation fails?

If "Yes" on these, the problem may be that your mail server is properly configured NOT to send from an external sender to another external address; that would constitute an open relay. Does your mail server act as it should for ordinary mail?

The solution to this (if my assumptions are correct) may be to make the DB server a trusted sender, by means of some kind of authentication (e.g. SMTP-AUTH). No need for tricks with the IP.
/RID
0
 
LVL 24

Author Comment

by:Jeff Certain
ID: 20288546
The database server originates the mail. It is co-located with one ISP.

The mail server belongs to a second ISP.

The database server sends the e-mail via the mail server. This fails for outside addresses.

The mail server has the database server IP specifically white-listed to permit relaying. In addition, I am using SMTP authentication, which succeeds for mail within the mail server's domain.

The mail server works normally for all normal e-mail.
0
 
LVL 24

Accepted Solution

by:
Jeff Certain earned 500 total points
ID: 21702747
Still baffled. Nothing I tried worked. I ended up writing a monitor process to resend e-mail as required.
0

Featured Post

Too many email signature updates to deal with?

Do you feel like you are taking up all of your time constantly visiting users’ desks to make changes to email signatures? Wish you could manage all signatures from one central location, easily design them and deploy them quickly to users? Well, there is an easy way!

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

747 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

11 Experts available now in Live!

Get 1:1 Help Now