sieve filter not working -- wildcard missing

Martin Johannes Dauser mdauser at cs.sbg.ac.at
Wed Feb 20 11:18:32 EET 2019


Hi!

You forgot the wildcard '.*' (= Match zero or more instances of any
single character, except newline)

require ["regex"];
# rule:[test]
if header :regex "from" ".*info$"
{
 	redirect "subbs at domain.com";
}

With this rule, you are filtering emails from toplevel domain '*.info'
or new domains that might occur in future (e.g '*.superinfo'). If you
want to restrict to classic tld '*.info' change the regex to

".*\.info$"


The draft lists a table of common regex in section2:
https://tools.ietf.org/html/draft-murchison-sieve-regex-08#section-2


There are online regex checker like https://regex101.com thought not
specific to sieve's regex, which can be used to test your regular
expressions. Sieve's regex are quite standard though.

Greetings
Martin


On Wed, 2019-02-20 at 14:00 +0530, subin ks via dovecot wrote:
> I've Dovecot and dovecot-sieve v 2.2.27 installed on a Debian 9.6.
> I'm trying to set a Sieve filter which will redirect all emails from
> `info` (i.e. .info) TLD to another email. This is the filter:
> 
> require ["regex"];
> # rule:[test]
> if header :regex "from" "info$"
> {
> 	redirect "subbs at domain.com";
> }
> 
> It's not being honored; all emails from .info TLD ends up in the
> inbox and none are redirected. Let me know what I'm doing wrong.
> 
> Thanks.
> 


More information about the dovecot mailing list