Do not mark unprocessed email as read

This commit is contained in:
johnnyq 2023-09-15 17:02:07 -04:00
parent deb5e87630
commit 6bd2919c18
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}