Page 1 of 1

Dovecot passwd SHA512-CRYPT and VestaCP

Posted: Fri Mar 13, 2015 9:12 pm
by krzysztofek
Hello,

On cPanel I have {SHA512-CRYPT}$6$ passwords. I changed dovecot config and everything is working, except passwords saved from VestaCP - it saving in MD5, as default. How to change it, and get work with SHA-512 passwords?

my pass scheme:

Code: Select all

test:{SHA512-CRYPT}$6$ypCemAhlqlwJfyB8$MG4OWVK1FHL/2/LTrP87dgFYYQ/aICgXonQIit7YI9Te3RfIYpa7sKiqJOG0impPisE2gakmXZ.ZNUr4H6KbP/:admin:mail::/home/admin:0
Best regards! :)

Re: Dovecot passwd SHA512-CRYPT and VestaCP

Posted: Sun Mar 15, 2015 8:20 pm
by skurudo
There is no simple answer, there need to add your code in /usr/local/vesta/bin/v-add-mail-account

Code: Select all

if [ -x '/usr/bin/doveadm' ]; then
    md5=$(/usr/bin/doveadm pw -s md5 -p "$password")
else
    md5=$(/usr/sbin/dovecotpw -s md5 -p "$password")
fi

if [[ "$MAIL_SYSTEM" =~ exim ]]; then
    str="$account:$md5:$user:mail::$HOMEDIR/$user:$quota"
    echo $str >> $HOMEDIR/$user/conf/mail/$domain/passwd
fi
But how it will work... dunno.

Re: Dovecot passwd SHA512-CRYPT and VestaCP

Posted: Tue Mar 17, 2015 5:23 pm
by krzysztofek
I found that earlier. I was thinking that I found, a code to generate here. cPanely actually generating SHA-512 hashes, where I can find script that generating this?

Re: Dovecot passwd SHA512-CRYPT and VestaCP

Posted: Tue Mar 17, 2015 5:39 pm
by skurudo
I don't know how CPanel generate passwords, it's wrong place to ask about it ;-)

Re: Dovecot passwd SHA512-CRYPT and VestaCP

Posted: Tue Mar 17, 2015 5:48 pm
by krzysztofek
I know, but there was, a little bit chance to get the info ;-) When I found the solution I'll give, a response in that topic for rest of community. Best regards!

Re: Dovecot passwd SHA512-CRYPT and VestaCP

Posted: Tue Mar 17, 2015 5:49 pm
by skurudo
Of course, if someone know the answer, it'll be good to read.

Re: Dovecot passwd SHA512-CRYPT and VestaCP

Posted: Thu Mar 19, 2015 9:42 am
by krzysztofek
I propably found the solution. In /usr/local/vesta/bin/v-add-mail-account we should code with mkpasswd command. I don't try because dovecot work with both encryptions. For me MD5 is enought. Old accounts have SHA512. Regards!

Re: Dovecot passwd SHA512-CRYPT and VestaCP

Posted: Thu Mar 19, 2015 11:28 am
by krzysztofek
VestaCP have dedicated plugin for roundcube... My installation exists in /var/lib.roundcube but driver is in /usr/share/roundcube. I copied, configured and it's not working. /var/log/roundcube say's that the driver is broken. I found that topic on GitHub: https://github.com/serghey-rodin/vesta/issues/88
and updated my driver. It's still not working... Now /var/log.roundcube says nothing and I'm gettng error from roundcube while trying to change my e-mail pass:
Error Ocurred!
Failed to save new password.

I transalted it from my language so it can look little diferent.
As I says, logs for now says nothing - Driver broken error disapear but now i have another problem.
Roundcube 1.1.0, newest VestaCP and Debian 7.5 64-bit.
Regards.

update:
vesta system.log output this:
2015-03-19 12:53:00 v-get-mail-account-value admin domain.tld mylogin md5

another observation:
When i put in new password field my current password procedure passed successful. But passwd file is untouched.
I also tried to change permissions, but without results.