[Dovecot] filtering problem using sieve
For some reason, I cannot filter messages that have uppercase or possibly mixed casing in them. I have tried several tests by connecting to port 25 and sending messages. The ones that fail are from MAILER-DAEMON@mydomain.net. Here are the rules I have tried:
require ["fileinto", "reject", "vacation"];
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] " mailer-daemon@mydomain.net" { fileinto "mailer-daemon"; stop; }
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] " MAILER-DAEMON@mydomain.net" { fileinto "mailer-daemon"; stop; }
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] " MAILER-DAEMON@mail.mydomain.net" { fileinto "mailer-daemon"; stop; }
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] " mailer-daemon@mail.mydomain.net" { fileinto "mailer-daemon"; stop; }
They all fail to deliver to my mail folder "mailer-daemon" and go to my inbox instead.
Anybody have any ideas what I am doing wrong? Also, how can I add a wildcard so that I do not have to
specify subdomains?
Thank you!
ajmcello ajmcello wrote:
For some reason, I cannot filter messages that have uppercase or possibly mixed casing in them. I have tried several tests by connecting to port 25 and sending messages. The ones that fail are from MAILER-DAEMON@mydomain.net mailto:MAILER-DAEMON@mydomain.net. Here are the rules I have tried:
require ["fileinto", "reject", "vacation"];
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] "mailer-daemon@mydomain.net mailto:mailer-daemon@mydomain.net" { fileinto "mailer-daemon"; stop; }
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] "MAILER-DAEMON@mydomain.net mailto:MAILER-DAEMON@mydomain.net" { fileinto "mailer-daemon"; stop; }
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] "MAILER-DAEMON@mail.mydomain.net mailto:MAILER-DAEMON@mail.mydomain.net" { fileinto "mailer-daemon"; stop; }
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] "mailer-daemon@mail.mydomain.net mailto:mailer-daemon@mail.mydomain.net" { fileinto "mailer-daemon"; stop; }
They all fail to deliver to my mail folder "mailer-daemon" and go to my inbox instead.
Anybody have any ideas what I am doing wrong?
AFIK, from the Sieve RFC draft[1], strings compare case-insensitive when no :comparator argument is given in the action, so I really don't known what is wrong, you could try to force the comparator, eg:
if header :comparator "i;ascii-casemap" :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] [ "mailer-daemon@one.example.com", "mailer-daemon@two.example.com", "mailer-daemon@three.example.com" ] { fileinto "mailer-daemon"; stop; }
Though, here, it works fine with(out) it.
Also, how can I add a wildcard so that I do not have to
specify subdomains?
Instead of ":contains" you can use ":matches", eg:
if header :matches "to" "mailer-daemon@*" {...}
HTH, Rui Lopes
[1] "2.7.3. Comparators" section at http://www.ietf.org/internet-drafts/draft-ietf-sieve-3028bis-09.txt
On Sunday 27 August 2006 20:47, ajmcello ajmcello wrote:
For some reason, I cannot filter messages that have uppercase or possibly mixed casing in them. I have tried several tests by connecting to port 25 and sending messages. The ones that fail are from MAILER-DAEMON@mydomain.net. Here are the rules I have tried:
require ["fileinto", "reject", "vacation"];
if header :contains ["To", "Cc", "Bcc", "Reply-To", "In-Reply-To"] " mailer-daemon@mydomain.net" { fileinto "mailer-daemon"; stop; }
depending on your namespace setup you may have to use "INBOX.mailer-daemon" or "INBOX/mailer-daemon"
Jim
participants (3)
-
ajmcello ajmcello
-
Jim Horner
-
Rui Lopes