Friday, October 24, 2014

"An attempt was made to access a socket in a way forbidden by its access permissions" - Database Mail Failure

Database Mail fails with the following error:

"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))."

Issue:

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.exe Anti-virus Standard Protection:Prevent mass mailing worms from sending mail (IP)

Fix:

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

8 comments:

  1. Thanks mate; very helpful nicely detailed.

    ReplyDelete
  2. Thank you very much

    ReplyDelete
  3. Thank you! It solved my problem!

    ReplyDelete
  4. thanks for this help! :D

    ReplyDelete
  5. Thank you SO much!....i have been looking for the solution several days...Thank you again!

    ReplyDelete
  6. Thank you! It solved my problem!

    ReplyDelete