Using DES/AES Encryption in Postfix Courier Configurations

You can use AES or DES to encrypt your database passwords, used by Postfix and Courier. Of course, as AES and DES use a key to encrypt the password, the one who knows the key may decrypt it.

You could also use Encrypt option to change this (to use MySQL's encrypt), but that's not available on all versions of Courier and Postfix for current operating systems without patching it.

In the following example, I'm simply encrypting the password using the user's e-mail address. You might want to vary this a bit, generating a stronger hash using the mysql functions md5, sha1 or password to create an encryption key. You might want to use a fix hash instead (in this case think of securing your server configuration as who can read your configuration files will be able to decrypt your passwords) or use a combination of fields hashed by md5 for example to create your key.