[Dovecot] Change password cheme

Timo Sirainen tss at iki.fi
Tue Mar 22 18:46:39 EET 2011


On 22.3.2011, at 15.20, Pascal Nobus wrote:

> We want to update our password scheme from crypt to SHA256.
> 
> Because usernames/passwords are in MySQL I thought this wouldn't be a problem.

So that'd be passdb and userdb sql.

> However: the password is not in the ENVIROMENT anymore.

Use passdb sql + userdb prefetch: http://wiki.dovecot.org/UserDatabase/Prefetch

Then have

password_query = select '%w' as userdb_password, ...

and now you'll have $PASSWORD environment. You could maybe also do this all by creating a mysql function that compares and updates the password directly, i.e:

password_query = select check_password('%u', '%w')



More information about the dovecot mailing list