sieve - find in header

Hajo Locke Hajo.Locke at
Tue Sep 6 13:25:38 UTC 2016

Hello list,

have a problem with sieve script. I want to perform an action if an 
arbitrary headerline contains a defined string.
I tried with regex:

if header :regex [".*"] ["searchstri.*"]
     fileinto "junk";

This is not working because regex is only used in 2nd argument 
In 1st argument [".*"] no regex is used, sieve expects just plain string.
Something like this would work, if "x-myheader" contains "searchstring":
if header :regex ["x-myheader"] ["searchstri.*"]....

How to solve this case and find a string in arbitrary/unknown headerline?


More information about the dovecot mailing list