Sieve regex error "invalid preceding regular expression"

ml at shadrinden.ru ml at shadrinden.ru
Fri Feb 19 07:54:07 EET 2021


Hi, everyone!

I'm trying to get the detail part of the address (i.e. anything that comes between + and @ in the address of this type: alias+detail at mydomain.tld) in this sieve:

if address :regex :localpart "to" "\+(.*)" {
  fileinto :create "${1}";
  stop;
}

However, when I try to compile it with sievec, I get this error:

error: invalid regular expression '+(.*)' for regex match: invalid preceding regular expression.

Why is that? Shouldn't I escape the plus sign? Itried also not escaping it, but I get the same error.


(A note why I don't use "envelope :detail" for that purpose: because the detail part of the address is not preserved in the "Envelope-To" after the message is redirected from alias to user. After that redirection the "Envelope-To" contain only user at mydomain.tld, not user+detail at mydomain.tld.)

-- 
Respectfully,
Denis Shadrin


More information about the dovecot mailing list