Skip to content

Commit

Permalink
Merge pull request #708 from Coeur2Boeuf/patch-1
Browse files Browse the repository at this point in the history
Update functions.inc.php for dovecot:CRYPT-METHOD
  • Loading branch information
DavidGoodwin committed Feb 20, 2023
2 parents 0344e72 + e53b5e8 commit 18b3638
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ function pacrypt($pw, $pw_db = "")

if (!empty($pw_db) && preg_match('/^{([0-9a-z-\.]+)}/i', $pw_db, $matches)) {
$method_in_hash = $matches[1];
if ('COURIER:' . strtoupper($method_in_hash) == $mechanism) {
if ( 'DOVECOT:' . strtoupper($method_in_hash) == $mechanism || 'COURIER:' . strtoupper($method_in_hash) == $mechanism) {
// don't try and be clever.
} elseif ($mechanism != $method_in_hash) {
error_log("PostfixAdmin: configured to use $mechanism, but asked to crypt password using {$method_in_hash}; are you migrating algorithm/mechanism or is something wrong?");
Expand Down Expand Up @@ -1328,7 +1328,7 @@ function pacrypt($pw, $pw_db = "")
}

if (preg_match('/^DOVECOT:(.*)$/i', $mechanism, $matches)) {
$mechanism = strtoupper($matches[1]);
return _pacrypt_dovecot($pw, $pw_db);
}

if (empty($pw_db)) {
Expand Down

0 comments on commit 18b3638

Please sign in to comment.