From 6bd2919c18ccca586b857d973cb9de56e55d9bcb Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 15 Sep 2023 17:02:07 -0400 Subject: [PATCH] Do not mark unprocessed email as read --- cron_ticket_email_parser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cron_ticket_email_parser.php b/cron_ticket_email_parser.php index 8932fba2..226fcf97 100644 --- a/cron_ticket_email_parser.php +++ b/cron_ticket_email_parser.php @@ -336,7 +336,7 @@ if ($emails) { $email_processed = false; // Get details from message and invoke PHP Mime Mail Parser - $msg_to_parse = imap_fetchheader($imap, $email, FT_PREFETCHTEXT) . imap_body($imap, $email); + $msg_to_parse = imap_fetchheader($imap, $email, FT_PREFETCHTEXT) . imap_body($imap, $email, FT_PEEK); $parser = new PhpMimeMailParser\Parser(); $parser->setText($msg_to_parse); @@ -430,6 +430,7 @@ if ($emails) { // Deal with the message (move it if processed, flag it if not) if ($email_processed) { + imap_setflag_full($imap, $email, "\\Seen"); imap_mail_move($imap, $email, $imap_folder); }