Include target mail address in exception msg when PGP encryption fails
This commit is contained in:
parent
df277c27e2
commit
c327ba6e04
|
@ -26,14 +26,14 @@ final class MDMailerHelper {
|
|||
$gpg->seterrormode(GNUPG_ERROR_EXCEPTION);
|
||||
|
||||
if (empty($recipients = $gpg->keyinfo($to))) {
|
||||
throw new \Exception("Cannot retrieve public key of recipient for GPG encryption");
|
||||
throw new \Exception("Cannot retrieve public key of recipient for GPG encryption for mail address: " . $to);
|
||||
}
|
||||
|
||||
foreach ($recipients as $recipient) {
|
||||
$recipient_fingerprint = $recipient["subkeys"][0]["fingerprint"];
|
||||
|
||||
if (empty($recipient = $gpg->addencryptkey($recipient_fingerprint))) {
|
||||
throw new \Exception("Cannot set public key of recipient for GPG encryption");
|
||||
throw new \Exception("Cannot set public key of recipient for GPG encryption for user: " . $to);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user