From 57a47874738e9b94f3c8168ed92f2764efb80ad3 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Thu, 6 Aug 2020 19:42:34 +0100 Subject: [PATCH] abort on any stderr output from doveadm ... see: https://github.com/postfixadmin/postfixadmin/issues/373#issuecomment-670007084 --- functions.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index d0bfe385..b153839a 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1029,6 +1029,7 @@ function _pacrypt_dovecot($pw, $pw_db = '') { fwrite($pipes[0], $pw . "\n", 1+strlen($pw)); usleep(1000); } + fwrite($pipes[0], $pw . "\n", 1+strlen($pw)); fclose($pipes[0]); @@ -1037,8 +1038,8 @@ function _pacrypt_dovecot($pw, $pw_db = '') { // Read hash from pipe stdout $password = fread($pipes[1], 200); - if (empty($password)) { - error_log("Failed to read password from $dovecotpw ... stderr: $stderr_output "); + if (!empty($stderr_output) || empty($password)) { + error_log("Failed to read password from $dovecotpw ... stderr: $stderr_output, password: $password "); throw new Exception("$dovecotpw failed, see error log for details"); }