diff --git a/virtual_feature.pl b/virtual_feature.pl index 026a0cf..3b37c25 100755 --- a/virtual_feature.pl +++ b/virtual_feature.pl @@ -107,7 +107,9 @@ sub mailbox_save 'enabled' => 1 }; if ($user->{'pass_crypt'}) { # Use stored hashed password - $suser->{'pass'} = $user->{'pass_crypt'}; + $suser->{'pass'} = $user->{'pass_unix'} || + $user->{'pass_md5'} || + $user->{'pass_crypt'}; } elsif ($user->{'passmode'} == 3 || defined($user->{'plainpass'})) { @@ -129,7 +131,9 @@ sub mailbox_save $suser->{'user'} = $user->{'user'}; } if ($user->{'pass'} ne $old->{'pass'}) { - $suser->{'pass'} = $user->{'pass_crypt'} || + $suser->{'pass'} = $user->{'pass_unix'} || + $user->{'pass_md5'} || + $user->{'pass_crypt'} || &htaccess_htpasswd::encrypt_password( $user->{'plainpass'}, undef, $d->[2]); } @@ -160,7 +164,9 @@ sub mailbox_modify $suser->{'user'} = $user->{'user'}; } if ($user->{'pass'} ne $old->{'pass'}) { - $suser->{'pass'} = $user->{'pass_crypt'} || + $suser->{'pass'} = $user->{'pass_unix'} || + $user->{'pass_md5'} || + $user->{'pass_crypt'} || &htaccess_htpasswd::encrypt_password( $user->{'plainpass'}, undef, $d->[2]); }