On Wed, 2019-02-20 at 10:18 +0100, Martin Johannes Dauser via dovecot wrote: > 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 "su...@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$"
Oh, and if you want to include a TLD like "*.superinfos" The regex needs to be ".*\..*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 "su...@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. > >