I had database e-mail setup and it was working for the past three years or so. Now all of a sudden it is not working. When I run the following query I see no users
SELECT l.name LoginName, u.name UserName, r.name RoleName
FROM master.sys.server_principals l
JOIN msdb.sys.database_principals u
ON u.sid = l.sid
LEFT JOIN msdb.sys.database_role_members rm
ON rm.member_principal_id = u.principal_id
LEFT JOIN msdb.sys.database_principals r
ON r.principal_id = rm.role_principal_id
WHERE l.name = SUSER_NAME()
AND r.name IN ('db_owner', 'DatabaseMailUser')
It seems like someone went in changed all the permissions of all the users. What should I do to get my e-mails working again? I have SQL Server 2008 R2.
SELECT l.name LoginName, u.name UserName, r.name RoleName
FROM master.sys.server_principals l
JOIN msdb.sys.database_principals u
ON u.sid = l.sid
LEFT JOIN msdb.sys.database_role_members rm
ON rm.member_principal_id = u.principal_id
LEFT JOIN msdb.sys.database_principals r
ON r.principal_id = rm.role_principal_id
WHERE l.name = SUSER_NAME()
AND r.name IN ('db_owner', 'DatabaseMailUser')
It seems like someone went in changed all the permissions of all the users. What should I do to get my e-mails working again? I have SQL Server 2008 R2.