Hello, I've got dovecot authenticating to a MySQL database. I've got a field varchar(128) called password. Whenever I create a password I use doveadm pw as in: doveadm pw -s sha512-crypt now i'd like to get MySQL to make a dovecot-specific password. My goal is to eventually have roundcube's password plugin working with this MySQL database to change the password. Thanks. Dave.
Hey, using the roundcube password plugin allows you to specify arbitrary statements for password_query. I'm using SHA512-CRYPT too and this is my $config['password_query']: "UPDATE vhostapi_prod.mail_accounts SET password=CONCAT(_utf8'{SHA512-CRYPT}',ENCRYPT(_utf8%p,CONCAT(_utf8'$6$', SUBSTRING(SHA(RAND()), -16)))) WHERE email=%u LIMIT 1" Cheers, Thore On 10.03.18 - 16:00, David Mehler wrote:> Hello, > > I've got dovecot authenticating to a MySQL database. I've got a field > varchar(128) called password. Whenever I create a password I use > doveadm pw as in: > > doveadm pw -s sha512-crypt > > now i'd like to get MySQL to make a dovecot-specific password. My goal > is to eventually have roundcube's password plugin working with this > MySQL database to change the password. > > Thanks. > Dave.-- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <https://dovecot.org/pipermail/dovecot/attachments/20180310/3b723048/attachment.sig>
Hi, Thanks. That query doesn't return any parse errors but it does say that it can't save the password. Any ideas? Thanks. Dave. On 3/10/18, David Mehler <dave.mehler at gmail.com> wrote:> Hello, > > Thanks. Trying that query adapted to my database table and getting an > error can not save password, any ideas? > > When you made your initial database tables how did you set up the > password field and in MySQL how did you make it? > > I'm trying to figure out what is different about your setup than mine. > > Thanks. > Dave. > > > On 3/10/18, Thore B?decker <me at foxxx0.de> wrote: >> Hey, >> >> using the roundcube password plugin allows you to specify arbitrary >> statements for password_query. >> >> I'm using SHA512-CRYPT too and this is my $config['password_query']: >> >> "UPDATE vhostapi_prod.mail_accounts SET >> password=CONCAT(_utf8'{SHA512-CRYPT}',ENCRYPT(_utf8%p,CONCAT(_utf8'$6$', >> SUBSTRING(SHA(RAND()), -16)))) WHERE email=%u LIMIT 1" >> >> >> Cheers, >> Thore >> >> On 10.03.18 - 16:00, David Mehler wrote: >>> Hello, >>> >>> I've got dovecot authenticating to a MySQL database. I've got a field >>> varchar(128) called password. Whenever I create a password I use >>> doveadm pw as in: >>> >>> doveadm pw -s sha512-crypt >>> >>> now i'd like to get MySQL to make a dovecot-specific password. My goal >>> is to eventually have roundcube's password plugin working with this >>> MySQL database to change the password. >>> >>> Thanks. >>> Dave. >> >> -- >> >> >
On 2018-03-10 (16:48 MST), David Mehler <dave.mehler at gmail.com> wrote:> > Thanks. That query doesn't return any parse errors but it does say > that it can't save the password.Are you referencing the right table in your database? -- It is the business of the future to be dangerous.