Question : SQL 2005 Database Mail Fails When Sending Through Exchange 2003

I am running SQL 2005 and Exchange 2003. Mail is sent with success from the SQL server to a recipient when I create an open relay connector on the Exchange server and use anonymous authentication on the SQL server. By corporate policy I cannot leave an open relay running I just used it for testing to make sure the servers would talk and mail would flow - it did.  So now when I try to use basic authentication on the SQL server and not use an open relay the messages fail. Below are the errors logged on both servers.

Here is message on SQL 2005 server mail log:
*********************************************
Date 2/11/2010 10:10:00 AM
Log Database Mail (Database Mail Log)

Log ID 1446
Process ID 4944
Mail Item ID 832
Last Modified 2/11/2010 10:10:00 AM
Last Modified By sa

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 9 (2010-02-11T10:10:00). Exception Message: Cannot send mails to mail server. (Unable to send to a recipient.). )

*********************************************

On the exchange server – three event IDs are logged. Here they are in order:

#1
*********************************************
Event Type: Failure Audit
Event Source: Security
Event Category: Account Logon
Event ID: 680
Date: 2/11/2010
Time: 10:09:59 AM
User: NT AUTHORITY\SYSTEM
Computer: MAIL
Description:
Logon attempt by: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Logon account: mydomain\serviceaccount
Source Workstation: SQL
Error Code: 0xC0000064

*********************************************

#2
*********************************************
Event Type: Failure Audit
Event Source: Security
Event Category: Logon/Logoff
Event ID: 529
Date: 2/11/2010
Time: 10:09:59 AM
User: NT AUTHORITY\SYSTEM
Computer: MAIL
Description:
Logon Failure:
Reason: Unknown user name or bad password
User Name: mydomain\serviceaccount
Domain:
Logon Type: 3
Logon Process: NtLmSsp
Authentication Package: NTLM
Workstation Name: SQL
Caller User Name: -
Caller Domain: -
Caller Logon ID: -
Caller Process ID: -
Transited Services: -
Source Network Address: -
Source Port: -

*********************************************

#3
*********************************************
Event Type: Failure Audit
Event Source: Security
Event Category: Logon/Logoff
Event ID: 529
Date: 2/11/2010
Time: 10:09:59 AM
User: NT AUTHORITY\SYSTEM
Computer: MAIL
Description:
Logon Failure:
Reason: Unknown user name or bad password
User Name: serviceaccount
Domain: mydomain
Logon Type: 3
Logon Process: Advapi
Authentication Package: Negotiate
Workstation Name: MAIL1
Caller User Name: MAIL1$
Caller Domain: MYDOMAIN
Caller Logon ID: (0×0,0×3E7)
Caller Process ID: 1500
Transited Services: -
Source Network Address: -
Source Port: -
*********************************************

Any help or advice will be greatly appreciated. Thank you.

Answer : SQL 2005 Database Mail Fails When Sending Through Exchange 2003

Problem solved.  Gave up on using Exchange.

Solution: Relay email through my Barracuda Spam & Virus firewall.  Works like a champ.  SPF information is good since it is still coming from my external IP and the doesn't care if I am sending email into or out of our organization.

Random Solutions  
 
programming4us programming4us