HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Restricting mail sending from SQL Server 2008

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
2008sqlsendingmailserverfromrestricting

Problem

On a remote database server, hosting databases from a number of different clients, how do I ensure that someone does not send emails using my profile?

Solution

You just need to ensure the profile isn't public when you assign permissions and access to it. The stored procedure in the msdb database is msdb.dbo.sysmail_add_principalprofile_sp, and this stored proc is what grants permissions for an msdb database role or user.

Excerpt taken from BOL on the subject:


To make a profile public, specify a @principal_id of 0 or a @principal_name of public. A public profile is available to all users in the msdb database, though users must also be a member of DatabaseMailUserRole to execute sp_send_dbmail.

BOL reference on Creating a Database Mail Private Profile.

Context

StackExchange Database Administrators Q#25887, answer score: 2

Revisions (0)

No revisions yet.