title: Postfix + MySQL ENCRYPT(), How does it verify the password with randomizing salt?
body: <p>I've implemented my mail server as dictated <a href="http://library.linode.com/email/postfix/courier-mysql-ubuntu-9.10-karmic#configure_mail_aliases" rel="nofollow">here</a>.</p>
  
  <p>It works perfectly fine. My curiousity revolves around entering users into the database and authenticating them</p>
  
  <p>Running:</p>
  
  <pre><code>INSERT INTO users (email, password) VALUES ('sales@example.com', ENCRYPT('password'));
  </code></pre>
  
  <p>Multiple times will give a different hash for the encrypted password as its utilizing a random salt. I.e. If I enter sales@example.com three times with the same password each hash is different...</p>
  
  <p>My question to this is, how is it that the Postfix server can actually authenticate the password when a user logs in via a mail client?</p>
  
  <p>There isn't any problem per say as it works fine, more just to satisfy my curiosity so I can fully understand whats going on behind the scenes to properly authenticate the encrypted password.</p>