| Author |  | 
      
        | seco Newbie
 
  
  
 Joined: 25 January 2015
 Location: Egypt
 Online Status: Offline
 Posts: 8
 | 
          Hi
           | Posted: 26 January 2015 at 4:46am | IP Logged |   |  
           | 
 |  i try to login using login-to-account.php found in examples folder
 but this one requires password
 and in my case passwords are md5(md5) and i cant login using it
 im asking can i login programmaticly without password
 thanks in advance.
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6167
 | 
          That's not possible, WebMail needs account password to tell it to IMAP server for authentication.
           | Posted: 26 January 2015 at 4:48am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | seco Newbie
 
  
  
 Joined: 25 January 2015
 Location: Egypt
 Online Status: Offline
 Posts: 8
 | 
          so how i can login with hashed password
           | Posted: 26 January 2015 at 5:01am | IP Logged |   |  
           | 
 |  or i have to store passwords in plain in db
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6167
 | 
          That's more of a question to mail server you are using. For WebMail, it doesn't matter what you supply as passwords.
           | Posted: 26 January 2015 at 5:05am | IP Logged |   |  
           | 
 |  
 In general case, email account passwords are supplied via integration API in unencrypted fashion - but that absolutely doesn't mean passwords are stored that way in a database. WebMail stores passwords in database encoded with a special two-way algorithm.
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | seco Newbie
 
  
  
 Joined: 25 January 2015
 Location: Egypt
 Online Status: Offline
 Posts: 8
 | 
          ok how i can know that password
           | Posted: 26 January 2015 at 5:36am | IP Logged |   |  
           | 
 |  i want to debug to see what is checking exactly and see how i can handle it
 could you give me the filename where password comparing with the stored one
 thanks in advance.
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6167
 | 
          That's libraries/MailSo/Imap/ImapClient.php file, see Login method there.
           | Posted: 26 January 2015 at 6:11am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | seco Newbie
 
  
  
 Joined: 25 January 2015
 Location: Egypt
 Online Status: Offline
 Posts: 8
 | 
          one last question
           | Posted: 26 January 2015 at 6:15am | IP Logged |   |  
           | 
 |  i found that there is /etc/shadow contains hashed passwords
 so in this case i have to save passwords in database plain or 2 way encryption if so what encryption do you recommend ?
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6167
 | 
          Your application will need a way to supply passwords in a form your IMAP server can handle. In the absolute majority of cases, that must be unencrypted form, so storing hashed password will just not work as it's one-way encoding.
           | Posted: 26 January 2015 at 6:21am | IP Logged |   |  
           | 
 |  
 In libraries/afterlogic/common/utils.php file, you'll find DecodePassword and EncodePassword methods which deal with password encoding. The methods are static and they use nothing but standard PHP functions so you can copy those to one of your classes and use them from there.
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | seco Newbie
 
  
  
 Joined: 25 January 2015
 Location: Egypt
 Online Status: Offline
 Posts: 8
 | 
          i found this file called integr.php
           | Posted: 26 January 2015 at 6:47am | IP Logged |   |  
           | 
 |  there is function called UserLoginByEmail it accepts null passwords
 what this function do exactly?
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6167
 | 
          
           | Posted: 26 January 2015 at 6:49am | IP Logged |   |  
           | 
 |  
| Quote: 
 
    
    | 
      
       | i found this file called integr.php there is function called UserLoginByEmail it accepts null passwords
 |  |  |  
 That doesn't look like something from current v7 of WebMail Pro. Make sure you actually use the latest version.
 
 --
 Regards,
 Igor, AfterLogiC Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | seco Newbie
 
  
  
 Joined: 25 January 2015
 Location: Egypt
 Online Status: Offline
 Posts: 8
 | 
          this is 6.1.3
           | Posted: 26 January 2015 at 6:51am | IP Logged |   |  
           | 
 |  i wanna know what does this function do
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6167
 | 
          No clue, sorry, that stuff is way too old.
           | Posted: 26 January 2015 at 6:53am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  |