Skip to content

Commit b4e9cb7

Browse files
authored
change password will break login in imap
Some body add ${quota}M But quota is not defined, so if password was changed passwd get incorrect value "M"
1 parent 9d48810 commit b4e9cb7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bin/v-change-mail-account-password

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ salt=$(generate_password "$PW_MATRIX" "8")
5555
md5="{MD5}$($BIN/v-generate-password-hash md5 $salt <<<$password)"
5656

5757
if [[ "$MAIL_SYSTEM" =~ exim ]]; then
58+
quota=$(grep $account $HESTIA/data/users/${user}/mail/${domain}.conf)
59+
quota=$(echo $quota | awk '{ print $7 }' | sed -e "s/'//g" )
60+
quota=$(echo $quota | cut -d "=" -f 2 | sed -e "s/unlimited/0/g")
5861
sed -i "/^$account:/d" $HOMEDIR/$user/conf/mail/$domain/passwd
5962
str="$account:$md5:$user:mail::$HOMEDIR/$user::userdb_quota_rule=*:storage=${quota}M"
6063
echo $str >> $HOMEDIR/$user/conf/mail/$domain/passwd

0 commit comments

Comments
 (0)