[Dovecot] Sieve doesnt filter
Hi!
I have a config like this (globalsieverc): require "fileinto"; if address :domain :is "to" "domain.de" { if header :matches "X-Spam-Level" "\\*\\*\\*\\*\\*\\*\\*\\*" { #discard; fileinto "spamdir"; } } else { # The rest goes into INBOX # default is "implicit keep", we do it explicitly here keep; }
It should filter all Mail for "domain.de" and then look for spam score.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 10 Mar 2008, Sven Schmidt wrote:
I have a config like this (globalsieverc): require "fileinto"; if address :domain :is "to" "domain.de" { if header :matches "X-Spam-Level" "\\*\\*\\*\\*\\*\\*\\*\\*" { #discard; fileinto "spamdir"; } } else { # The rest goes into INBOX # default is "implicit keep", we do it explicitly here keep; }
I guess, this is just a simplification of you real filter, therefore one remard:
keep is not reached, if address matches, but header not.
====
The regex does not look correct, use just one backslash per asterisk.
BTW: I would use
header :contains "X-Spam-Level" "*****"
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFH1moSVJMDrex4hCIRAuUzAJsGlUUts80v1TxtrGv69JCCUzDBBQCfQuQB l4U+oTgWC7sVeeS1clUw+VM= =GBDx -----END PGP SIGNATURE-----
Steffen Kaiser schrieb:
I guess, this is just a simplification of you real filter, therefore one remard:
keep is not reached, if address matches, but header not.
====
The regex does not look correct, use just one backslash per asterisk.
BTW: I would use
header :contains "X-Spam-Level" "*****"
Bye, After a little more trying, I found the target mailbox.
But now I want to copy a mail not move a mail, it is possible?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 12 Mar 2008, Sven Schmidt wrote:
But now I want to copy a mail not move a mail, it is possible?
Nope.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFH1723VJMDrex4hCIRAtoSAJ980NlqUHyVdH3ZgHScyBJz9WAXnQCfe55F JTdP2GOcOqiBaAywxh9BrkA= =UQS3 -----END PGP SIGNATURE-----
Hey everybody,
I had a similar problem with a sieve filter lately and was desperatly looking for a tool to test my filter conditions. In the end I used 'exim -d -bf', which works quiet well, but does not interpret sieve the same way the deliver plugin does (probably different sieve version).
Is there a tool to test sieve filters, which behaves like the deliver plugin and writes a lot of output about the way it interprets the single commands and conditions?
Chris.
Hello Sven,
Monday, March 10, 2008, 5:17:58 PM, you wrote:
require "fileinto"; if address :domain :is "to" "domain.de" { if header :matches "X-Spam-Level" "\\*\\*\\*\\*\\*\\*\\*\\*" { #discard; fileinto "spamdir"; } }
I vaguely remembers having problems with using regular expressions; how about using ":contains" instead of ":matches"?
For the record, here's a .dovecot.sieve for one of my accounts:
require ["fileinto", "imapflags"]; if header :contains "X-Spam-Checked-By" "myhostid" { if header :contains "X-Spam-Level" "******" { if header :contains "X-Spam-Level" "********" { setflag "\\Seen"; } fileinto "Junk"; stop; } } elsif allof ( header :contains "Subject" "Undelivered Mail Returned To Sender", address :is "From" "MAILER-DAEMON@myhostname" ) { fileinto "INBOX.Undelivered"; } else { keep; }
-- Best regards, Robert Tomanek dovecot@mail.robert.tomanek.org
participants (4)
-
Chris Vogel
-
Robert Tomanek
-
Steffen Kaiser
-
Sven Schmidt