« Previous Next »

Thread: Cannot get IIS pickup directory. NEED HELP

Last post 10-20-2009 11:08 AM by artisticcheese. 23 replies.

Average Rating Rate It (5)

RSS

Page 1 of 2 (24 items) 1 2 Next >

Sort Posts:

  • 10-06-2006, 1:19 PM

    Cannot get IIS pickup directory. NEED HELP

    I am using 2.0 to try to send an email to the IisPickup directory

    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);

    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

  • 10-06-2006, 2:39 PM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 6,229
    • IIS MVPs

    Re: Cannot get IIS pickup directory. NEED HELP

    I've never had to specify client.DeliveryMethod - I just identify what host to use and send the message.
  • 10-06-2006, 3:07 PM In reply to

    Re: Cannot get IIS pickup directory. NEED HELP

    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

  • 10-06-2006, 3:32 PM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 6,229
    • IIS MVPs

    Re: Cannot get IIS pickup directory. NEED HELP

    Then what happens exactly when it doesn't work? You didn't mention a specific error message or symptom.
  • 10-06-2006, 5:07 PM In reply to

    Re: Cannot get IIS pickup directory. NEED HELP

    The error message is on the website www.andrewworral.com ( hit the button)

     the error is basically the subject "Cannot Get IIS Pickup Directory"

     

  • 10-06-2006, 5:31 PM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 6,229
    • IIS MVPs

    Re: Cannot get IIS pickup directory. NEED HELP

  • 10-06-2006, 5:45 PM In reply to

    Re: Cannot get IIS pickup directory. NEED HELP

    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

  • 10-08-2006, 11:47 PM In reply to

    • Bernard
    • Top 50 Contributor
    • Joined on 05-24-2006, 4:30 AM
    • Malaysia
    • Posts 291
    • IIS MVPs

    Re: Cannot get IIS pickup directory. NEED HELP

    What's the exception error? from what you describe it looks like the code can't read the metabase key value.
    Cheers,
    Bernard Cheah
  • 10-09-2006, 8:45 AM In reply to

    Re: Cannot get IIS pickup directory. NEED HELP

    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

     

  • 10-09-2006, 10:06 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 6,229
    • IIS MVPs

    Re: Cannot get IIS pickup directory. NEED HELP

    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

  • 10-09-2006, 12:15 PM In reply to

    Re: Cannot get IIS pickup directory. NEED HELP

    Well I checked with filemon.  If I specify the pickup directory in c# the email goes out fine.  If I use IIS it never touched the pickup directory.  (see two buttons on www.andrewworral.com)

    So I would assume its not a permission problem on the Pickup Directory.  Maybe on the metabase, but Asp.net can access the metabase for other runtime things I believe.

    Microsoft Guys???  anyone have any ideas?


    -Andy

  • 10-09-2006, 6:42 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Cannot get IIS pickup directory. NEED HELP

    I don't think NetworkService (which the worker process runs as by default) has access to SmtpSvc key in the metabase by default - can you check that?
    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 10-09-2006, 7:24 PM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 6,229
    • IIS MVPs

    Re: Cannot get IIS pickup directory. NEED HELP

  • 10-10-2006, 3:34 AM In reply to

    • Bernard
    • Top 50 Contributor
    • Joined on 05-24-2006, 4:30 AM
    • Malaysia
    • Posts 291
    • IIS MVPs

    Re: Cannot get IIS pickup directory. NEED HELP

    I just checked my test w2k3 R2 build - by default network service can query and enumerate the subkey.

    Cheers,
    Bernard Cheah
  • 10-10-2006, 8:35 AM In reply to

    Re: Cannot get IIS pickup directory. NEED HELP

    What is the best tool/way to check the permissions on the metabase.  I am more of a c# programmer that got thrust into doing the IIS stuff as well, and it can have a little bit of a learning curve.

    Do I just need to check ACL's on the metabase.xml or is their an internal API to set permissions to it?

    I have run the aspnet_regiis -ga <account> on pretty much any account I can think of (I may have missed one but)

    If it is a permission issue why wouldn't the Send() return a permissions error?

    Here is the code for the internal call that is throwing the error.

    www.andrewworral.com/iispickup.txt

    Thanks for all of your guys help!

    -Andy

Page 1 of 2 (24 items) 1 2 Next >
Microsoft Communities