"The mail could not be sent to the recipients because of the mail server failure. Exception Message: Could not connect to mail server. (An attempt was made to access a socket in a way forbidden by its access permissions (IP))."
A recent McAfee Anti-Virus update began to block programs from sending mail unless they appear on a list of excluded programs. SQL Server Database Mail does not appear on that list by default.
You may see an error in the McAfee logs such as:
Date_Time - (Path)\MSSQL\Binn\DatabaseMail.exeAnti-virus Standard Protection:Prevent mass mailing worms from sending mail(IP)
Go to the Access Protection Properties in the VirusScan console.
Select Anti-Virus Standard Protection.
Highlight mass mailing worms, and edit the property.
Add DatabaseMail.exe to the list of excluded programs.
This was seen on SQL Server 2012, though it is relevant to all SQL Server versions using Database Mail and has to do with the McAfee configuration.
While trying to add a node to a SQL Server 2008 R2 cluster, I encountered a problem where the service account credentials were not being accepted during installation. These AD credentials were already in use on the active node.
These are the errors:
The specified credentials for the SQL Server service are not valid. To continue, provide a valid account and password for the SQL Server service.
Microsoft.SqlServer.Configuration.SqlEngine.ValidationException: The specified credentials for the SQL Server service are not valid. To continue, provide a valid account and password for the SQL Server service.
The credentials you provided for the SQL Server Agent service are invalid. To continue, provide a valid account and password for the SQL Server Agent service.
Microsoft.SqlServer.Configuration.Agent.InputValidationException: The credentials you provided for the SQL Server Agent service are invalid. To continue, provide a valid account and password for the SQL Server Agent service.
I knew the AD account credentials I was trying to use were correct. After searching and seeing numerous suggestions such as making sure you have entered the correct password, I decided to follow one of the suggestions: Reboot and try again!
Sure enough, after reboot, the install progressed past the credentials screen without difficulty and the node was added to the cluster.
Since I didn't see the error published along with a concise "do this to fix" response out there, and since several reports of this error were on versions older than SQL 2008 R2, I decided to publish this to hopefully save you some time. One note, make sure that your service account has local admin to the node, at minimum for the duration of the install.