I've been struggling with Postfix for past few days. Finally I managed to set it up with virtual mailboxes listed in MySQL and passwords encrypted with PAM. It was just then that I realized I need the passwords to be stored not-encrypted!

I can't seem to find whether it's possible or not. Can someone please guide me to the right direction?


To explain myself, I'm making a web application and I want the same username and password of a user to be his email's too. So I configured Postfix and Courier to use my webapp's database so users come with an email address once they have an account in the webapp. The thing is, I need to access users' inboxes in the webapp so I have to be able to pass the clear form of users' password through IMAP protocol to Courier in my code. That's why I need all of the parties to use a clear form of password.

  • PAM uses encryption libraries to do its encryption (Blowfish, MD5, etc), I'm not sure what the default encryption library is (linux_crypt maybe)? – NickW May 23 '14 at 14:38
  • The thing is, I want it to use no encryption at all! I want the passwords to be stored and later compared as they are, in clear form. – Mehran May 23 '14 at 14:40
  • 1
    Storing plain text passwords is a horrible, horrible idea. Do you mean you want to be able to use plain text passwords in POP3/IMAP/SMTPAuth ? – NickW May 23 '14 at 14:43
  • 2
    By taking the user input, comparing it to the DB, then passing the user input to the server if it matches. Doesn't require plaintext in the DB.. – NickW May 23 '14 at 15:48
  • 2
    @Mehran very happy that I persuaded you to avoid plaintext passwords in the DB :) – NickW May 23 '14 at 16:34

As Nick told me, it is a bad practice to store passwords in clear form in database. I managed to find a way around it so I'll be storing passwords encrypted after all. But if there's any scenario that can not escape this bad practice, I must say that my tests showed me that even though I configured Postfix to use PAM for encryption but when I stored passwords in clear form, they would still be matched!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.