<div dir="ltr">I run my family email server using postfix + dovecot + mysql + spamassassin + roundcube. When I first set up the server I follow the Digital Ocean tutorial <b><a href="https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin">here</a>. </b>I want my users to be able to change their password in roundcube, however, their documentation for the password plugin wants me to set SQL query string as follows,<div><br></div><div><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:normal;white-space:pre-wrap;color:rgb(36,41,46)"><font face="arial, helvetica, sans-serif">UPDATE users SET password=ENCRYPT(%p,concat(_utf8'$1$',right(md5(rand()),8),_utf8'$')) WHERE username=%u LIMIT 1
</font></pre><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:normal;white-space:pre-wrap;color:rgb(36,41,46)"><font face="arial, helvetica, sans-serif"><br></font></pre><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:normal;white-space:pre-wrap;color:rgb(36,41,46)"><font face="arial, helvetica, sans-serif">This is using md5 for the hashing where as I am using SHA (also I do not have a users table). See below,</font></pre><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:normal;white-space:pre-wrap;color:rgb(36,41,46)"><font face="arial, helvetica, sans-serif"><br></font></pre><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:normal;white-space:pre-wrap;color:rgb(36,41,46)"><pre style="border-radius:3px;box-sizing:border-box;word-wrap:normal;padding:13px 17px;margin-top:0px;margin-bottom:28px;color:rgb(0,0,0);overflow:auto"><code style="border-radius:3px;color:rgb(58,58,58);line-height:22px;padding:0px;margin:0px;box-sizing:border-box"><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">INSERT INTO `servermail`.`virtual_users`
(`id`, `domain_id`, `password` , `email`)
VALUES
('1', '1', ENCRYPT('firstpassword', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), '<a href="mailto:email1@example.com">email1@example.com</a>'),</font></code></pre></pre><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:normal;white-space:pre-wrap;color:rgb(36,41,46)"><font face="arial, helvetica, sans-serif">I want to format this query correctly. Any help would be appreciated.</font></pre></div></div>