From a08d376023cbc5e5ae7917a6916fcfc343846248 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 19 Mar 2024 19:59:33 +0100 Subject: [PATCH] Added: Search in HEADER. Like: "header=X-Rspamd-Action no action" --- .../app/libraries/MailSo/Imap/SearchCriterias.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/SearchCriterias.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/SearchCriterias.php index 78df5839a..6f8e74db9 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/SearchCriterias.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/SearchCriterias.php @@ -19,7 +19,7 @@ namespace MailSo\Imap; class SearchCriterias { const - RegEx = 'in|e?mail|from|to|subject|has|is|date|since|before|text|body|size|larger|bigger|smaller|maxsize|minsize|keyword|older_than|newer_than|on|senton|sentsince|sentbefore'; + RegEx = 'in|e?mail|from|to|subject|has|is|date|since|before|text|body|size|larger|bigger|smaller|maxsize|minsize|keyword|older_than|newer_than|on|senton|sentsince|sentbefore|header'; /** https://datatracker.ietf.org/doc/html/rfc3501#section-6.4.4 @@ -234,6 +234,14 @@ class SearchCriterias $aCriteriasResult[] = 'HEADER Content-Type multipart/report'; break; + case 'HEADER': + $aValue = \explode(' ', $sRawValue, 2); + $aCriteriasResult[] = 'HEADER ' + . static::escapeSearchString($oImapClient, $aValue[0]) + . ' ' + . static::escapeSearchString($oImapClient, $aValue[1]); + break; + case 'FLAGGED': case 'UNFLAGGED': case 'SEEN': @@ -433,6 +441,7 @@ class SearchCriterias case 'BEFORE': case 'OLDER': case 'YOUNGER': + case 'HEADER': if (\strlen($mValue)) { $aResult[$sName] = $mValue; }