Solved

Troubleshooting database mail (SMTP relay issue?)

Posted on 2007-11-14
9
4,611 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
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
 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

630 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