• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 658
  • Last Modified:

Database Mail

I'm trying to send mail from sql server 2008 using database mail. When i send a test mail i can recieve it to my company email. But when I send to a hotmail account or any other external email account i get the message:

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2010-09-10T19:16:50). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay).

Any help would be greatly appreciated.
0
rbasilides
Asked:
rbasilides
  • 10
  • 10
1 Solution
 
Josh ThomasSystems AdministratorCommented:
http://www.sqlnewsgroups.net/group/microsoft.public.sqlserver.server/topic23749.aspx

According to this, you can't use an external email account, it needs to be SMTP (which would be Exchange or whatever SMTP server you're using)
0
 
AkhaterCommented:
yes this is normal because you need to allow relaying for your SQL on your exchange server

please check this article to accomplish
http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/A_2666-Allow-relaying-on-Exchange-2007-Exchange-2010-in-4-easy-steps.html
0
 
rbasilidesAuthor Commented:
I've created the recieve connector and set up the approriate options but I'm still getting the "5.7.1 Unable to realy" error. After I've created the recieve connector I made sure to reset the Transport service and do an Edge sync but still does not work.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
AkhaterCommented:
did you add an addtional IP to your exchange server and set this receive connector to listen only to that IP ?
0
 
rbasilidesAuthor Commented:
Would I need to create an open relay in the Accepted Domains? It works when I do set that up.
0
 
AkhaterCommented:
no

did you follow my article ?

1. did you add ip address to the server ?
2. did you configure an extra receive connector to listen to this ip ?
0
 
rbasilidesAuthor Commented:
If I have an Edge Transport server do I set up this recieve connector on the Edge or the Hub?
0
 
AkhaterCommented:
hub
0
 
rbasilidesAuthor Commented:
With the extra IP address do I have to adjust my firewall settings since I have all smtp fowarded to my Edge server?
0
 
AkhaterCommented:
no you don't need to change any settings, just add an IP address on the server

again did you read the article?
0
 
rbasilidesAuthor Commented:
I've read the article and have done exactly what it says but I'm still getting the error.
I created the new conncetor. Set the fqdn. Local IP is set to the new one with port 25. Added the remote IP of the application server. Set permissions group for anonymous users and gave the extended rights.

I really appreciate your help too!
0
 
AkhaterCommented:
ok did you configure the application to use the NEW ip as SMTP service /?
0
 
rbasilidesAuthor Commented:
Here's a little bit of more background:

This was actually already working before. Did not realize till this past weekend that it was broke. Looking at the logs seems to be that it stopped working right around the time I deployed the Edge Server in out DMZ. At the time when I deployed it I had issues with Symnatec Mail Security which resolved.
0
 
AkhaterCommented:
ok let me try to summarize things in a way I would understand them

1. you have and exchange 2007 server with 2 IPs IPa and IPb
2. you have 2 Receive connectors on your Exchange 2007 server
3. Connector A is configured to listen to all IPs and to accept connections from all IPs
4. Connector B is configured to listen ONLY to IPb and to accept connections ONLY from SQL IPc
5. both connector A and B are listening to port 25
6. you have modified Connector B to allow anonymous relay as per my article
7. you have configured SQL to use IPb (and NOT IPa) port 25 as its SMTP server


am I right in all points ?
0
 
rbasilidesAuthor Commented:
I got it working by actually setting up the recieve connector on the Edge Server.
0
 
AkhaterCommented:
so you where pointing you SQL to talk with the Edge server and not the hub right ?
0
 
rbasilidesAuthor Commented:
I guess what I failed to mention is that this is a server that is in a remote location so it's actually hitting mail.company.com from over the internet so it hits the edge server first..
0
 
AkhaterCommented:
:) ok that's it
0
 
rbasilidesAuthor Commented:
I mistakenly assumed that all edge server settings had to be updated on the hub server thru edge synchronization. Finally started to play around with the edge server and saw that I was able to create recieve connectors on there.
0
 
rbasilidesAuthor Commented:
I really appreciate you help on this.

For future reference is it best practice if you have an application server internally that needs relaying to use a seperate IP address?
0
 
AkhaterCommented:
yes it is so you don't enable anonymous relaying on the default IP on which everyone has the right to connect.

you create a separate connector on which you allow relaying but you restrict its access to specific IPs
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 10
  • 10
Tackle projects and never again get stuck behind a technical roadblock.
Join Now