brunonymous / vpopmail

Vpopmail is a set of programs for creating and managing multiple virtual domains on a qmail server, with full support for many POP/IMAP servers
GNU General Public License v3.0
5 stars 3 forks source link

Remove pw_passwd prefix like {SHA512-CRYPT} #5

Closed semhoun closed 2 years ago

semhoun commented 2 years ago

Dovecot (maybe others) allow to use multiple crypt scheme but they had to be prefixed by {XXXX-CRYPT} if is not the default scheme. As this way of writing is common (in ldap by exemple) but accepted by crypt, i remove it before passing the pw_passwd to crypt.

It's usefull for changing the default crypt scheme without forcing users to change they password.

PatriceDuh commented 2 years ago

We are not sure to understand this change. vpopmail is not using dovecot password format (in vpopmail.c, mkpasswd3 is using for example $6$ to use SHA512 with the crypt function), when is {XXXX-CRYPT} inserted in the password ? by dovecot ?

semhoun commented 2 years ago

As dovecot has removed the vpopmail auth driver removed, I (and I hope not only me) use the sql auth driver. If all the password has the same crypt scheme no problem, but if you want to migrate to SHA512 by exemple, You had 2 solutions, change all password, or mixed the scheme. For this second solution vpopmail has no problem, but If hash is not prefixed with {XXXX-CRYPT} dovecot always use the default scheme. I use a script to change the password in database and have vpopmail and dovecot working with MD5 and SHA512. Maybe this patch is only needed by me.