Scalix filters vs. Sieve - action stop;

Best practice information from Scalix users relating to integration of Scalix with other products.

Moderator: ScalixSupport

Dilyan Palauzov

Scalix filters vs. Sieve - action stop;

Postby Dilyan Palauzov » Mon Apr 27, 2009 10:31 am

Hello,

I run our incoming mails via spamassassin. Depending on the probability for spamminess, I want to put the message in a different folder:

Mails with 15 or more spamassassin scores go into folger Spam3
Mails 10 spamassassin or more, but less than 15 go into folger Spam2
Mails 5 spamassassin or more, but less than 10 go into folger Spam1
The rest goes into folder Inbox.

However when a mail with 15 spamassassin points arrives it is stored in all three folders. How can I avoid this?

How shall I write the rules, so that they behave like that?

I added the rules with
#/bin/sh

/opt/scalix/bin/sxaa --user "$1" --file "Spam3" --header "X-Spam-Level: +++++++++++++++" --title Spam3
/opt/scalix/bin/sxaa --user "$1" --file "Spam2" --header "X-Spam-Level: ++++++++++" --title Spam2
/opt/scalix/bin/sxaa --user "$1" --file "Spam1" --header "X-Spam-Level: +++++" --title Spam1

resulting # tf.browse -i 000003d
HEADER (DN) 1 0 2 1002 0x0 0x0 0 0x0 0x0 0x2 0x0 0x0 ""
AA_NO () 0x0 600 0 0 0 0 "" "" "" "" "" "Spam3"
FILTER_STRING () 0x0 0x0 39 1 0 0 "X-Spam-Level: +++++++++++++++"\
"" "" "" ""
AA_FILE () 0x0 0x1 0 0 "" "" "" "" "" "Spam3"
AA_NO () 0x0 601 0 0 0 0 "" "" "" "" "" "Spam2"
FILTER_STRING () 0x0 0x0 39 1 0 0 "X-Spam-Level: ++++++++++" "" \
"" "" ""
AA_FILE () 0x0 0x1 0 0 "" "" "" "" "" "Spam2"
AA_NO () 0x0 602 0 0 0 0 "" "" "" "" "" "Spam1"
FILTER_STRING () 0x0 0x0 39 1 0 0 "X-Spam-Level: +++++" "" "" \
"" ""
AA_FILE () 0x0 0x1 0 0 "" "" "" "" "" "Spam1"

Thanks in advance for your feedback.

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Re: Scalix filters vs. Sieve - action stop;

Postby Valerion » Tue Apr 28, 2009 1:07 am

Outlook has a "Stop processing more rules" action. Try this on one account and have a peek at the resulting 3d file, then copy that to the other users as a base.

kcsc
Posts: 62
Joined: Thu Oct 04, 2007 11:35 am
Location: US

Re: Scalix filters vs. Sieve - action stop;

Postby kcsc » Tue Apr 28, 2009 3:33 pm

You can use exceptions and stop processing rules. Here is an example:

Code: Select all

HEADER            (DN)  1  0  2  1002  0x0  0x0  0  0x0  0x0  0x2  0x0  0x0  ""
AA_NO             (DN)  0x0  1000  0  0  0  0  ""  ""  ""  ""  ""  "Junk Email"
FILTER_STRING     (DN)  0x0  0x0  39  1  0  0  "X-Spam-Level: *****"  ""  "U\
TF8"  ""  ""
AA_FILE           (DN)  0x0  0x1  0  0  ""  ""  ""  ""  ""  "Junk E-mail"
AA_LAST           (DN)  0x0
AA_NO             (DN)  0x0  1001  0  0  0  0  ""  ""  ""  ""  ""  "Possible J\
unk"
FILTER_START      (DN)  0x0  0x0  0
FILTER_STRING     (DN)  0x0  0x0  39  1  0  0  "X-Spam-Flag: YES"  ""  "UTF8\
"  ""  ""
FILTER_STRING     (DN)  0x1  0x0  39  1  0  0  "X-Spam-Level: *****"  ""  "U\
TF8"  ""  ""
FILTER_END        (DN)
AA_FILE           (DN)  0x0  0x1  0  0  ""  ""  ""  ""  ""  "Possible Junk"
AA_LAST           (DN)  0x0
AA_NO             (DN)  0x0  1002  0  0  0  0  ""  ""  ""  ""  ""  "Newsletter\
s"
FILTER_START      (DN)  0x0  0x0  0
FILTER_START      (DN)  0x0  0x0  1
FILTER_STRING     (DN)  0x0  0x0  39  1  0  0  "USER_IN_SPF_WHITELIST"  ""  \
"UTF8"  ""  ""
FILTER_STRING     (DN)  0x0  0x0  39  1  0  0  "USER_IN_WHITELIST"  ""  "UTF\
8"  ""  ""
FILTER_END        (DN)
FILTER_STRING     (DN)  0x1  0x0  39  1  0  0  "NSWL"  ""  "UTF8"  ""  ""
FILTER_END        (DN)
AA_FILE           (DN)  0x0  0x1  0  0  ""  ""  ""  ""  ""  "Newsletters"
AA_LAST           (DN)  0x0


The "AA_LAST (DN) 0x0" is the stop processing rules, I implemented this and all default rules as all non-outlook" rules. Outlook rules give the goofy error and disable rules if the folders are deleted, where non-outlook rules just recreate the folder.

In FILTER_STRING (DN) 0x1 0x0 39 1 0 0 "X-Spam-Level: *****" "" "UTF8" "" "" the 0x1 is the negation meaning it is less than a score of 5

Dilyan Palauzov

Re: Scalix filters vs. Sieve - action stop;

Postby Dilyan Palauzov » Thu Apr 30, 2009 6:09 am

Hello,

Valerion wrote:Outlook has a "Stop processing more rules" action. Try this on one account and have a peek at the resulting 3d file, then copy that to the other users as a base.


This does apply the new rules for the users, however in Outlook 2003 the users whom I copied the 3d file, see their own, old rules as inactive and my new rules, enforced by copying the 3d file are invisible.

Greetings,
Dilian

Dilyan Palauzov

Re: Scalix filters vs. Sieve - action stop;

Postby Dilyan Palauzov » Thu Apr 30, 2009 6:18 am

Hello,

kcsc wrote:You can use exceptions and stop processing rules. Here is an example:

The "AA_LAST (DN) 0x0" is the stop processing rules, I implemented this and all default rules as all non-outlook" rules. Outlook rules give the goofy error and disable rules if the folders are deleted, where non-outlook rules just recreate the folder.

In FILTER_STRING (DN) 0x1 0x0 39 1 0 0 "X-Spam-Level: *****" "" "UTF8" "" "" the 0x1 is the negation meaning it is less than a score of 5


Let me state, that I couldn't find documentation for the format of the 3d file, apart from http://scalix.org/wiki/index.php?title= ... to_Actions . It relies on the tool tf.browse, which on itself is not documented, too. This I cannot obtain the 3d file, modify it and upload it back to the server.

Apart from this, if I copy a 3d file from one user to another, the second user cannot see or edit these rules in Outook (2003), the old rules are not deleted, but stay there as inactive.

Please advice me how can I manage flexibly the rules of the users from the command line.

Със здраве,
Дилян

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Re: Scalix filters vs. Sieve - action stop;

Postby Valerion » Mon May 04, 2009 1:21 am

The best way to go about this is to modify a copy of sxaa and use that, since it already interfaces with the 3d file. You can add some custom rule actions here, once you know what the 3d file contents looks like. As for interoperability with Outlook, that is a bit of a pain, yes.

Just running tf.browse with no parameters gives you a command-line usage list. tf.browse -i and tf.browse -g are used to read and create the 3d file. As an example, on my server tf.browse -i /var/opt/scalix/by/s/user/g000037/000003d dumps my own rules to the command line.


Return to “Third Party Integration”



Who is online

Users browsing this forum: No registered users and 1 guest