allow option to skip encryption for mails

This commit is contained in:
Martin Portius 2023-10-04 14:53:33 +02:00
parent c327ba6e04
commit 0f99446c92

View File

@ -21,6 +21,10 @@ final class MDMailerHelper {
* @return string * @return string
*/ */
public static function pgp_encrypt(string $to, string $msg):string { public static function pgp_encrypt(string $to, string $msg):string {
// Skip encryption if PGP_ENC_KEY is null
if (MD_CONF_EMAIL::PGP_ENC_KEY === null) {
return $msg;
}
$gpg = new gnupg(); $gpg = new gnupg();
$gpg->seterrormode(GNUPG_ERROR_EXCEPTION); $gpg->seterrormode(GNUPG_ERROR_EXCEPTION);