diff --git a/src/MDMailerHelper.php b/src/MDMailerHelper.php index 88013bd..03943b1 100644 --- a/src/MDMailerHelper.php +++ b/src/MDMailerHelper.php @@ -23,7 +23,7 @@ final class MDMailerHelper { */ public static function pgp_encrypt(string $to, string $msg):string { - $msg = shell_exec("echo " . escapeshellarg($msg) . " | gpg2 --always-trust --recipient " . escapeshellarg($to) . " --encrypt --armor --local-user " . escapeshellarg(MD_CONF_EMAIL::PGP_ENC_KEY) . " --sign"); + $msg = shell_exec("echo " . escapeshellarg($msg) . " | gpg --always-trust --homedir " . escapeshellarg(MD_CONF_EMAIL::PGP_HOMEDIR) . " --recipient " . escapeshellarg($to) . " --encrypt --armor --local-user " . escapeshellarg(MD_CONF_EMAIL::PGP_ENC_KEY) . " --sign"); if ($msg === null) return "Error encrypting message"; return $msg;