From 46b7c5536aea4b428f35a067f1afe9a0452e6455 Mon Sep 17 00:00:00 2001 From: frytimo Date: Wed, 22 May 2024 01:51:50 -0300 Subject: [PATCH] Prevent deleting the email when fax sender is not authorized (#6981) * Prevent deleting the email when fax sender is not authorized --- app/fax/fax_emails.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/fax/fax_emails.php b/app/fax/fax_emails.php index 74f1bb793a..c7e4715ec1 100644 --- a/app/fax/fax_emails.php +++ b/app/fax/fax_emails.php @@ -262,11 +262,14 @@ if (!empty($result) && @sizeof($result) != 0) { //reset variables unset($fax_numbers); - } - //delete email - if (imap_delete($connection, $email_id, FT_UID)) { - imap_expunge($connection); + //delete email + if (imap_delete($connection, $email_id, FT_UID)) { + imap_expunge($connection); + } + } + else { + //unauthorized sender } } unset($authorized_senders);