mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
sha-512 passwords func
This commit is contained in:
parent
1a7612cc66
commit
8a3f8592cc
4 changed files with 44 additions and 22 deletions
|
@ -48,12 +48,11 @@ is_password_valid
|
|||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
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
|
||||
# Generating hashed password
|
||||
salt=$(gen_password "$PW_MATRIX" "8")
|
||||
md5="{MD5}$($BIN/v-generate-password-hash md5 $salt <<<$password)"
|
||||
|
||||
# Adding account info into password file
|
||||
if [[ "$MAIL_SYSTEM" =~ exim ]]; then
|
||||
str="$account:$md5:$user:mail::$HOMEDIR/$user:$quota"
|
||||
echo $str >> $HOMEDIR/$user/conf/mail/$domain/passwd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue