ml at shadrinden.ru
2021-Feb-19 05:54 UTC
Sieve regex error "invalid preceding regular expression"
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
> On 19/02/2021 07:54 ml at shadrinden.ru wrote: > > > 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 ShadrinTry '[+](.*)' Regards, Aki