SYMPTOMS
In the
sp_processmail stored procedure, the value for the
@set_user parameter incorrectly defaults to "Guest" instead of the security context of the user that is currently executing the query.
The
sp_processmail topic in SQL Server 2000 Books Online states the following about the
sp_processmail parameter [
@set_user =] 'user':
Is the security context in which the query should be run. user is sysname. If user is not specified, the security context defaults
to that of the user executing xp_sendmail.
However, the output of
sp_helptext @objname = 'sp_processmail' reveals the following:
create procedure sp_processmail
@subject varchar(255)=NULL,
@filetype varchar(3)='txt',
@separator varchar(3)='tab',
@set_user varchar(132)='guest',
@dbuse varchar(132)='master'
as ...
If a user database does not have the Guest account enabled and you execute the
sp_processmail stored procedure without explicitly specifying the
@set_user option, you may see the following error message:
ODBC error 916 (08004) Server user 'guest' is not a valid user in database 'Database_name'.