T
Tim Mavers
I have written a simple Windows Service (C#) that occassionally needs to
send out emails. Due to the security requirements from my client, I
need to run the service with as little security rights as possible. So
far I have managed to get the service running if the user is a member of
the "Power Users" group, which I think will be ok security-wise.
The problem is when the service attempts to send out an email, I get the
following errors (I am including all the InnerException messages in
hopes that it might help). I am also running the standard Microsoft
SMTP server that ships with IIS.
--- Exception Messages ---
System.Web.Exception = "Could not access 'CDO.Message' object."
_InnerException = "Exception has been thrown by the target of an
invocation."
_InnerException = "The "SendUsing" configuration value is invalid."
---------- End -----------
If I add the user (that the service runs under) to the Administrators
group, the email is sent out successfully _every time_ without any
problems, so I know that my SmtpMail code is correct and this is really
some odd permission/privilege problem.
Unfortunately, I can't suggest that using an Administrator account to
run this service as a requirement for my service unless Microsoft
explicity documents that you need Admin rights to send email using .NET/CDO.
I have checked the \inetpub\mailroot and have given FULL-ACCESS rights
to the user so that's the not the problem. Being a Power-User also to
seems to give R/W access to the C:\Windows tree (where CDO.SYS is
located), so I am at a loss from a file-system security perspective.
Finally, I am using Windows XP Pro SP1 (with latest SP1), but am only
using .NET 1.0 (sp2) -- v1.0.3705.364 -- again due to client limitations.
Searching Google, I have found that many people encounter the same
problem (at least the same top-level error), however I have been unable
to find a definitive answer other than make the user an Administrator or
update the machine.config (I am not using ASP.NET so this is not
applicable).
Thanks for any help,
send out emails. Due to the security requirements from my client, I
need to run the service with as little security rights as possible. So
far I have managed to get the service running if the user is a member of
the "Power Users" group, which I think will be ok security-wise.
The problem is when the service attempts to send out an email, I get the
following errors (I am including all the InnerException messages in
hopes that it might help). I am also running the standard Microsoft
SMTP server that ships with IIS.
--- Exception Messages ---
System.Web.Exception = "Could not access 'CDO.Message' object."
_InnerException = "Exception has been thrown by the target of an
invocation."
_InnerException = "The "SendUsing" configuration value is invalid."
---------- End -----------
If I add the user (that the service runs under) to the Administrators
group, the email is sent out successfully _every time_ without any
problems, so I know that my SmtpMail code is correct and this is really
some odd permission/privilege problem.
Unfortunately, I can't suggest that using an Administrator account to
run this service as a requirement for my service unless Microsoft
explicity documents that you need Admin rights to send email using .NET/CDO.
I have checked the \inetpub\mailroot and have given FULL-ACCESS rights
to the user so that's the not the problem. Being a Power-User also to
seems to give R/W access to the C:\Windows tree (where CDO.SYS is
located), so I am at a loss from a file-system security perspective.
Finally, I am using Windows XP Pro SP1 (with latest SP1), but am only
using .NET 1.0 (sp2) -- v1.0.3705.364 -- again due to client limitations.
Searching Google, I have found that many people encounter the same
problem (at least the same top-level error), however I have been unable
to find a definitive answer other than make the user an Administrator or
update the machine.config (I am not using ASP.NET so this is not
applicable).
Thanks for any help,