sieve rule for "header don't exist"
Reindl Harald
h.reindl at thelounge.net
Mon Mar 30 10:49:43 UTC 2015
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://dovecot.org/pipermail/dovecot/attachments/20150330/28e673be/attachment-0001.sig>
More information about the dovecot
mailing list