Skip to content

Commit fc17d75

Browse files
committed
fixed dovecot md5 generation
1 parent 1069543 commit fc17d75

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/v-change-mail-account-password

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ is_object_unsuspended "mail/$domain" 'ACCOUNT' "$account"
4646
#----------------------------------------------------------#
4747
# Action #
4848
#----------------------------------------------------------#
49-
md5=$(/usr/sbin/dovecotpw -s md5 -p "$password")
49+
50+
if [ -x '/usr/bin/doveadm' ]; then
51+
md5=$(/usr/bin/doveadm pw -s md5 -p "$password")
52+
else
53+
md5=$(/usr/sbin/dovecotpw -s md5 -p "$password")
54+
fi
55+
5056
sed -i "/^$account:/d" $HOMEDIR/$user/conf/mail/$domain/passwd
5157
str="$account:$md5:$user:mail::$HOMEDIR/$user:$quota"
5258
echo $str >> $HOMEDIR/$user/conf/mail/$domain/passwd

0 commit comments

Comments
 (0)