I'm trying to set up filter rules for sieve to add a flag and a header to incoming messages with a regex, but sieve fails as soon as there's a german umlaut within the subject.
Here's my sieverule
require ["fileinto","editheader","variables","regex","imap4flags","encoded-character"];
if anyof (header :regex :comparator "i;ascii-casemap" "Subject" "([0-9]{3}-[0-9]{7}-[0-9]{7})")
{
addheader :last "X-OrderID" "${0}";
addflag "\\Flagged";
addflag "${0}";
}
The subject is something like this:
Rückfrage zur Lieferung einer Bestellung von xxx (Bestellung: 304-1962494-2978192)
and the second letter, ü
, is causing the trouble.
When I try and send the message without it, everything works as supposed.
The messages are of this type:
MIME-Version: 1.0
Content-Type: multipart/mixed;
When there are umlauts within the subject, it is changed to
=?UTF-8?Q?R=C3=BCckfrage_zur_Lieferung_einer_Bestellung_von
but I didn't find a way to convert this so far.
On my research I found an extension to sieve called mime
https://www.rfc-editor.org/rfc/rfc5703
however, if I try to require it in the require part of my script I get an error and if I try to set it as an additional extension to sieve it doesn't reload the config, saying the extension is not known.
Can someone help me on fixing this?