| Author | 
         | 
         
      
        
         
         greenbee Newbie 
          
 
  Joined: 21 July 2008 Location: Russian Federation
 Online Status: Offline Posts: 3
          | 
        
         
          
           | Posted: 21 July 2008 at 8:26am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
I'm trying to connect to a pop mail server using NTLM.
 This code:
 
 Pop3.LicenseKey = licenseKey;
              Pop3 server = new Pop3();
              server.SslMode = MailBee.Security.SslStartupMode.Manual;
              server.SslProtocol = MailBee.Security.SecurityProtocol.Tls1;
              server.Connect(txtServer.Text,  int.Parse(txtPort.Text), false);
              server.Login(null, null, MailBee.AuthenticationMethods.SaslNtlm, MailBee.AuthenticationOptions.None, null);
 
 works perfect in a desktop application
 but does not work when used in a webform with <identity impersonate="true" />
 Error: The server has rejected authentication data sent by the client. The server responded: -ERR Logon Failure.
 I've tried many different values for
 server.SslMode
 server.SslProtocol
 AuthenticationMethods
 AuthenticationOptions
 sometimes I get another error meaning that the method is not supported or something like that. But the most of the time I get the error above.
 
 When I provide my login and password instead of null with the all other settings remaining the same the login is successfull
 
 What to do with that?
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Alex AfterLogic Support 
          
  
  Joined: 19 November 2003
 Online Status: Offline Posts: 2207
          | 
        
         
          
           | Posted: 21 July 2008 at 9:10am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Probably impersonation is not working as you expected. You should make sure your web application is actually executed under the context of your user account. For instance, check what System.Security.Principal.WindowsIdentity.GetCurrent().Name returns.
 
 See the following link for more information:
  http://msdn.microsoft.com/en-us/library/xh507fc5(VS.71).aspx 
 
 Regards,
 Alex
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         greenbee Newbie 
          
 
  Joined: 21 July 2008 Location: Russian Federation
 Online Status: Offline Posts: 3
          | 
        
         
          
           | Posted: 22 July 2008 at 4:25am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Impersonation works as expected.
 System.Security.Principal.WindowsIdentity.GetCurrent().Name returns the current user name - the same as in the desktop application
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Igor AfterLogic Support 
          
 
  Joined: 24 June 2008 Location: United States
 Online Status: Offline Posts: 6168
          | 
        
         
          
           | Posted: 22 July 2008 at 7:22am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Please try to check "Load User Profile" setting of your application pool.  To find it, open the list of application pools in IIS Manager, select the application pool you are using and open "Advanced Settings..." section.
 
 Regards,
 Igor.
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         greenbee Newbie 
          
 
  Joined: 21 July 2008 Location: Russian Federation
 Online Status: Offline Posts: 3
          | 
        
         
          
           | Posted: 22 July 2008 at 8:15am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
I'm using Windows Server 2003
 There is no such option in IIS Manager for Application Pool...
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Andrew AfterLogic Support 
          
 
  Joined: 28 April 2006 Location: United States
 Online Status: Offline Posts: 1189
          | 
        
         
          
           | Posted: 23 July 2008 at 6:50am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
We're investigating this, but have not succeeded yet.
 
 We found some hints and are trying them:
 
  http://www.velocityreviews.com/forums/t70658-impersonate-and -iis6-driving-me-nuts.html
  http://technet2.microsoft.com/windowsserver/en/library/b3d24 617-7673-4f10-8408-5250374fd4311033.mspx?mfr=true 
  http://technet2.microsoft.com/windowsserver/en/library/06c46 43a-34e8-4d47-a674-89f4e79fd0fa1033.mspx?mfr=true 
   
 
 Best regards,
 Andrew
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Alex AfterLogic Support 
          
  
  Joined: 19 November 2003
 Online Status: Offline Posts: 2207
          | 
        
         
          
           | Posted: 24 July 2008 at 7:37am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Looks like a bug in Windows 2003 POP3 service. SMTP service of the same mail server (Windows 2003 IIS) is working fine with NTLM in Windows Integrated Authentication mode and impersonation.
 
 Regards,
 Alex
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   |