I am using 2.0 to try to send an email to the IisPickup directory
<div style="background-color: lightsteelblue; border: black 1px solid; padding: 4px">
System.Net.Mail.MailMessage message =
new System.Net.Mail.MailMessage(test@testing.com,
"test@test.com",
"Testing " +
DateTime.Now.ToString(),
"Testing the Mail Drop Folder");
System.Net.Mail.SmtpClient client =
new System.Net.Mail.SmtpClient("127.0.0.1");
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.PickupDirectoryFromIis;
client.Send(message);
This code worked on our old deployment server but not on our new server. I set a specific directory it works, but I have compiled outdated code that needs the IIS reference to work.
It doesn't seem to be a security problem as System.Net.Mail.IisPickupDirectory.GetPickupDirectory() is not returning a security exception.
I am not sure if something is off in the metabase or what it is.
I need to get this working ASAP. Any suggestions would be greatly appreciated.
I want to write straight to the Pickup Directory because I am sending large numbers of emails in batches. And would rather let the SMTP service handle them then take up time doing the SMTP authentication for each email.
I'm not sure why I am getting this error at all I might need someone from microsoft or an MVP to help me out on this.
Microsoft guys? I can't believe I am the only person to ever get this error. I have seen posts from others having similiar problems but it was due to impersonation being used which I am not doing.
Go to www.andrewworral.com and hit the button. It will give you the error. The error it gives is somewhat generic. The error is triggered by the Microsoft internal
I am not sure what part is causing the error, I believe that if .net couldn't read or have access to the metabase that I would have had errors at runtime on my site.
The pickup directory is set correctly and return correctly when running
adsutil.vbs enum SMTPsvc/1
I was supposed to have this fixed about a week ago, but cannot find the solution. Anyone have any ideas? If it is a security issue, whom do I have to give permission to? And what steps would you recommend me taking to check/add these securities?
Do I need to run a specific script or just check acl on metabse.xml?
The error is occuring at .Send, which suggests to me it is a file security issue (which BTW doesn't make sense since it does work if you manually specify the folder path). Strange.
AndyBuffaloN...
9 Posts
Cannot get IIS pickup directory. NEED HELP
Oct 06, 2006 05:19 PM|LINK
I am using 2.0 to try to send an email to the IisPickup directory
<div style="background-color: lightsteelblue; border: black 1px solid; padding: 4px">System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(test@testing.com, "test@test.com", "Testing " + DateTime.Now.ToString(), "Testing the Mail Drop Folder");
</div>System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("127.0.0.1");
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.PickupDirectoryFromIis;
client.Send(message);
Example Site : www.andrewworral.com (hit the button)
This code worked on our old deployment server but not on our new server. I set a specific directory it works, but I have compiled outdated code that needs the IIS reference to work.
It doesn't seem to be a security problem as System.Net.Mail.IisPickupDirectory.GetPickupDirectory() is not returning a security exception.
I am not sure if something is off in the metabase or what it is.
I need to get this working ASAP. Any suggestions would be greatly appreciated.
-Andy
tomkmvp
7657 Posts
MVP
Moderator
Re: Cannot get IIS pickup directory. NEED HELP
Oct 06, 2006 06:39 PM|LINK
http://mvp.support.microsoft.com/
AndyBuffaloN...
9 Posts
Re: Cannot get IIS pickup directory. NEED HELP
Oct 06, 2006 07:07 PM|LINK
I want to write straight to the Pickup Directory because I am sending large numbers of emails in batches. And would rather let the SMTP service handle them then take up time doing the SMTP authentication for each email.
I'm not sure why I am getting this error at all I might need someone from microsoft or an MVP to help me out on this.
Microsoft guys? I can't believe I am the only person to ever get this error. I have seen posts from others having similiar problems but it was due to impersonation being used which I am not doing.
thanks!
-Andy
tomkmvp
7657 Posts
MVP
Moderator
Re: Cannot get IIS pickup directory. NEED HELP
Oct 06, 2006 07:32 PM|LINK
http://mvp.support.microsoft.com/
AndyBuffaloN...
9 Posts
Re: Cannot get IIS pickup directory. NEED HELP
Oct 06, 2006 09:07 PM|LINK
The error message is on the website www.andrewworral.com ( hit the button)
the error is basically the subject "Cannot Get IIS Pickup Directory"
tomkmvp
7657 Posts
MVP
Moderator
Re: Cannot get IIS pickup directory. NEED HELP
Oct 06, 2006 09:31 PM|LINK
http://mvp.support.microsoft.com/
AndyBuffaloN...
9 Posts
Re: Cannot get IIS pickup directory. NEED HELP
Oct 06, 2006 09:45 PM|LINK
IIS 6.0
Here is the ACL ( I have been adding everyone and their neighbor to it so it might be off a little)
Path : Microsoft.PowerShell.Core\FileSystem::C:\Inetpub\mailroot\Pickup
Owner : BUILTIN\Administrators
Group : HT-NY2\None
Access : NT AUTHORITY\NETWORK SERVICE Allow Write, ReadAndExecute, Synchronize
BUILTIN\Administrators Allow FullControl
S-1-5-21-2294809668-4216756895-883427651-1012 Deny FullControl
BUILTIN\Administrators Allow FullControl
Everyone Allow FullControl
NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Users Allow FullControl
Audit :
Sddl : O:BAG:S-1-5-21-2294809668-4216756895-883427651-513D:AI(A;OICI;0x1201bf;;;NS)(A;;FA;;;BA)(D;OICIID;FA;;;S-1-5-2
1-2294809668-4216756895-883427651-1012)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;WD)(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BU
)
I can get the PickupDirectory using adsutil.vbs enum SMTPsvc/1/ and it points to the same directory.
Funny thing is that if I in c# use the
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.SpecifiedPickupDirectory;
client.PickupDirectoryLocation = @"C:\Inetpub\mailroot\Pickup\";
It will send fine, which confuses me as to why it is probably not a securtiy issue.
- A very frustrated Andy
qbernard
5016 Posts
MVP
Moderator
Re: Cannot get IIS pickup directory. NEED HELP
Oct 09, 2006 03:47 AM|LINK
Bernard Cheah
AndyBuffaloN...
9 Posts
Re: Cannot get IIS pickup directory. NEED HELP
Oct 09, 2006 12:45 PM|LINK
Go to www.andrewworral.com and hit the button. It will give you the error. The error it gives is somewhat generic. The error is triggered by the Microsoft internal
System.Net.Mail.IisPickupDirectory.GetPickupDirectory()
I am not sure what part is causing the error, I believe that if .net couldn't read or have access to the metabase that I would have had errors at runtime on my site.
The pickup directory is set correctly and return correctly when running
adsutil.vbs enum SMTPsvc/1
I was supposed to have this fixed about a week ago, but cannot find the solution. Anyone have any ideas? If it is a security issue, whom do I have to give permission to? And what steps would you recommend me taking to check/add these securities?
Do I need to run a specific script or just check acl on metabse.xml?
Thank you for any help!
-Andy
tomkmvp
7657 Posts
MVP
Moderator
Re: Cannot get IIS pickup directory. NEED HELP
Oct 09, 2006 02:06 PM|LINK
The error is occuring at .Send, which suggests to me it is a file security issue (which BTW doesn't make sense since it does work if you manually specify the folder path). Strange.
Does FileMon indicate anything?
http://www.sysinternals.com/Utilities/Filemon.html
http://mvp.support.microsoft.com/