I enabled Database Mail XPs and was testing it on my dev machine. I was just wondering if the DB Mail is a bad security choice, and if it more secure (or standard practice) to send this kind of message via an application server (ColdFusion or PHP)? I would be using the Database Mail for DB backup/restore messages, errors or error checking messages (that I can think of). I am aware that enabling a feature always increases risk.


  • behind firewalls, etc..
  • Windows 2012 r2
  • MS SQL Server 2012
  • Exchange is on separate server
  • Using Windows Authentication
  • Enabled require secure connection

Thanks in advance.

  • 1
    Risk of what? Someone sending unauthorized e-mails? (This can be prevented at your SMTP server of course.) Someone intercepting and reading your backup reports? Oct 31, 2015 at 23:27
  • Still relatively new to DB administration, I was not sure of any unknown feature(s) that might also be enabled by turning on the Database Mail switch. Or if the standard practice is to keep Database Mail off, and pass the info to the application layer.
    – Musselman
    Nov 2, 2015 at 18:38

2 Answers 2


While your question would probably be borderline duplicate of this one, I'm not real fond of the answer to the other question as it does not go into to much detail of the security risk.

Database mail is configurable to include who can use the profiles/accounts created. You have the following security measures when you enable Database Mail:

(Reference this answer by Thomas Stringer)

  • A public profile is only available to users in msdb database
  • Users of msdb database must also be member of DatabaseMailUserRole in order to execute `sp_send_dbmail

The one thing to consider outside of the above is with your application and the data you are allowing to be sent via email. For example, if you are making a generic function that will allow users to send a report either via Database Mail or your application; you need to ensure there is no sensitive data being sent (especially user data). It all depends if there are any security standards for your company or the industry you are in, if any extra measures need to be put in place. I know for some if a report is being sent it simply has to have disclosure notification on the report that maybe the user acknowledges whether there is sensitive data included.

You may also add in security measures on your email system or Exchange that has policy where any email sent from the SQL Server instance or your application, can only go to internal email. It would not be allowed to send email to an outside domain name.

Is it worth the risk?

I would not consider it a risk at all based on the above information. It is a common tool used for any DBA (e.g. job failure notification, alerting, etc.) and can be a vital part of monitoring. I enable on an instance based on the need for support. Some environments it may not be preferred to setup on EVERY instance in your network (if large) and in that you may put it on an instance utilized for central monitoring.


Yes, Database Mail is a standard practice to report failing database maintenance jobs to the DBA mailbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.