sieve rule for "header don't exist"
is there a way to expresse when the header "X-Spam-Status" *do not* exist move the message to a different folder?
:contains, :matches and :is are not helpful here
background: the spamass-milter option -B is lacking the spamassassin headers in case of milter-rejects and via sendmail generated BCC while flagged messages contain the headers - so it would be nice to move the rejected ones to a subfolder "REJECTED" instead into the inbox
On 2015-03-30 11:25, Reindl Harald wrote:
is there a way to expresse when the header "X-Spam-Status" *do not* exist move the message to a different folder?
:contains, :matches and :is are not helpful here
Have you tried using the "exist" test from the sieve rfc
5.5. Test exists
Usage: exists <header-names: string-list>
The "exists" test is true if the headers listed in the header-names
argument exist within the message. All of the headers must exist or
the test is false.
The following example throws out mail that doesn't have a From header
and a Date header.
Example: if not exists ["From","Date"] {
discard;
}
https://tools.ietf.org/html/rfc5228#page-28
i have not tried it myself but the core of rfc 5228 is reported to be fully support by pigeonhole
regards
- christian
Am 30.03.2015 um 11:41 schrieb Christian Kivalo:
On 2015-03-30 11:25, Reindl Harald wrote:
is there a way to expresse when the header "X-Spam-Status" *do not* exist move the message to a different folder?
:contains, :matches and :is are not helpful here
Have you tried using the "exist" test from the sieve rfc
indeed - that works - thanks!
require ["fileinto"]; if not exists ["X-Spam-Status"] { fileinto "REJECTED"; } else { keep; }
5.5. Test exists
Usage: exists <header-names: string-list> The "exists" test is true if the headers listed in the header-names argument exist within the message. All of the headers must exist or the test is false. The following example throws out mail that doesn't have a From header and a Date header. Example: if not exists ["From","Date"] { discard; }
https://tools.ietf.org/html/rfc5228#page-28
i have not tried it myself but the core of rfc 5228 is reported to be fully support by pigeonhole
participants (2)
-
Christian Kivalo
-
Reindl Harald