title: for a user id java.mail throws 'AUTHENTICATE failed.' , but can log in through browser
body: <p>I am using <strong>java mail api</strong> for reading the mails (using imap). I have <strong>2 different mail boxes</strong> to read.</p>
  
  <p>Following is configuration used :-</p>
  
  <pre><code>Microsoft Exchange Server 2007
  
  java mail  :- tried javamail-1.4 , javamail-1.5
  imap.url=imapmail.somedomain.com
  imap.port=143
  
  mail.user1=user_id_doesnt_work
  mail.pwd1=some_pwd
  
  mail.user2=user_id_works
  mail.pwd2=some_pwd
  </code></pre>
  
  <p>java code :-</p>
  
  <pre><code>private void loginInbox() throws MessagingException{
  
      Folder inbox = null;
      Properties mailProps =  mailProps = new Properties();
  
     mailProps.put("mail.store.protocol", "imapmail.somedomain.com");
     mailProps.put("mail.imap.starttls.enable", "true");
     mailProps.put("mail.imap.starttls.required", "true");
  
     Session session = Session.getDefaultInstance(mailProps);
     Store store = session.getStore();
  
     store.connect("imapmail.somedomain.com", 143, EMAILUSER, EMAILPWD);    //throws exception here
  
     inbox = store.getFolder(INBOX);
     inbox.open(Folder.READ_WRITE);
  
  }
  </code></pre>
  
  <blockquote>
    <p>I am able to <strong>login to both mail boxes through browser</strong> ,with both user
    id and password (url = imapmail.somedomain.com )</p>
  </blockquote>
  
  <p><strong>> Using JavaMail :-</strong></p>
  
  <p>Using java mail 'mail.user2=user_id_works' , I am able to login to mail.</p>
  
  <p>But When I use java mail 'mail.user1=user_id_doesnt_work' throws exception :</p>
  
  <blockquote>
    <p>javax.mail.AuthenticationFailedException: AUTHENTICATE failed.    at
    com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:723)   at
    javax.mail.Service.connect(Service.java:364)</p>
  </blockquote>
  
  <p>Could be there <strong>any server settings</strong> for that particular user which prevents login attempt ?
  Any thoughts would be appreciated.</p>