title: How to pass md5-encrypted password to IMAP server instead of plain text
body: <p>I am writing an email client which is part of a larger web application for a company. The user is authenticated by logging into the whole web application by creating an MD5 hash and comparing it to the one that is stored in the database.</p>
  
  <p>However, this is outside of my scope. I have only access to the one way hash in the database. As the same credentials for email and web app shall be used, is there a way to pass the MD5 hash instead of plain text to an IMAP server through Java Mail? I would think so, as the mail server would do nothing else but creating a hash of the plain text password and comparing it anyway. But how to do it in IMAP in Java Mail?</p>
  
  <p>Thanks</p>