Feature #61231
Filter text contains is missing for sxaa utility
0%
Description
Currently sxaa utility supports following conditions
Specifying Conditions It is also possible to specify a simple condition to apply to a rule. There are a number of possible conditions: --subject, --sender, --header and --itemclass. Some example uses : sxaa --user "Sam Orr" --file "JUNK" --subject "SPAM" sxaa --user "Sam Orr" --file "dave" --sender "dave@example.com" sxaa --user "Sam Orr" --file "Spam?" --header "X-Spam-Status:***" sxaa --user "Sam Orr" --file "Sched" --itemclass "IPM.Schedule"
But there are no condition, which allows to filter emails and contains some word in text (email body).
Please see attached files which adds text filtering for sxaa during rule creation .
Command line example to redirect email to another user if email body contains some text
sxaa --user "USER1" --redirect USER2@site.com --retain --contains "e-mail contains this text"
Files
History
Updated by Danny T about 2 years ago
- Status changed from New to In Progress
Thanks, I will roll in your changes to 12.7.1 and merge to 13.
Updated by Danny T about 2 years ago
Alexey, I am about to commit your sxaa.py change, but this bit looks a bit odd:
# # Add any filter that has been supplied # if filter_type == "CONTAINS": text_template[8] = ("s",gWildcard + filter_value + gWildcard) if filter_not: subject_template[2] = "0x01" aa_file.append(text_template) if filter_type == "SUBJECT": subject_template[8] = ("s",gWildcard + filter_value + gWildcard) if filter_not: subject_template[2] = "0x01" aa_file.append(subject_template)
The 7th line, should it be text_template not subject_template?
Updated by Alexey Bobyr about 2 years ago
Hi,It seems yes. I can retest "not" contains tomorrow and provide more reliable version.On 8 Nov 2018 5:41 p.m., rmSupport <rmSupport@scalix.com> wrote:
Issue #61231 has been updated by Danny T.
- Add any filter that has been supplied
#
if filter_type == "CONTAINS":
text_template8 = ("s",gWildcard + filter_value + gWildcard)
if filter_not:
subject_template2 = "0x01"
aa_file.append(text_template)
if filter_type == "SUBJECT":
subject_template8 = ("s",gWildcard + filter_value + gWildcard)
if filter_not:
subject_template2 = "0x01"
aa_file.append(subject_template)
The 7th line, should it be text_template not subject_template?
Feature #61231: Filter text contains is missing for sxaa utility
Author: Alexey BobyrStatus: In ProgressPriority: NormalAssignee: ServerDevsGroupCategory: Scalix ServerTarget version: 12.7.1Operation System: --Milestone: All versions
Currently sxaa utility supports following conditions
Specifying Conditions
It is also possible to specify a simple condition to apply to a rule.
There are a number of possible conditions: --subject, --sender, --header and --itemclass. Some example uses :
sxaa --user "Sam Orr" --file "JUNK" --subject "SPAM"
sxaa --user "Sam Orr" --file "dave" --sender "dave@example.com"
sxaa --user "Sam Orr" --file "Spam?" --header "X-Spam-Status:***"
sxaa --user "Sam Orr" --file "Sched" --itemclass "IPM.Schedule"
But there are no condition, which allows to filter emails and contains some word in text (email body).
Please see attached files which adds text filtering for sxaa during rule creation .
Command line example to redirect email to another user if email body contains some text
sxaa --user "USER1" --redirect USER2@site.com --retain --contains "e-mail contains this text"
Files
sxaa
(28.4 KB)
sxaa.diff
(4.05 KB)
You have received this notification because you have either subscribed to it, or are involved in it.To change your notification preferences, please click here: http://rm.scalix.com/my/account
Updated by Alexey Bobyr about 2 years ago
uploading fixed version.
Email will be redirected if to another user if it does not contains text
sxaa --user "USER1" --redirect USER2 --retain --not --contains "some text"
Email will be redirect if email body will contain text , with local copy
sxaa --user "USER1" --redirect USER2 --retain --contains "some text"
Updated by Danny T about 2 years ago
Commit to trunk (scalix13):
r15036 | danny | 2018-11-09 12:04:49 -0500 (Fri, 09 Nov 2018) | 3 lines Changed paths: M /trunk/genesis/src/m/sxaa.1 M /trunk/initial/opt/scalix/bin/sxaa RM61231: Filter text contains is missing for sxaa utility Check in --contains changes on behalf of ABR, and update man page
Will try to rebuild scalix13 server packages ...
Updated by Danny T about 2 years ago
Latest build uploaded to /var/nfs:
-rw-r--r-- 1 nobody nobody 18049736 Nov 12 04:36 rhel7/scalix-server-13.99.0.15036-1.rhel7.x86_64.rpm -rw-r--r-- 1 nobody nobody 17320052 Nov 12 04:36 ubuntu16/scalix-server_13.99.0.15036_amd64.ubuntu16.deb
Updated by Danny T about 2 years ago
Merged to 12.7.1
r15037 | danny | 2018-11-16 11:55:10 -0500 (Fri, 16 Nov 2018) | 4 lines Changed paths: M /branches/Bluenose/genesis/src/m/sxaa.1 M /branches/Bluenose/initial/opt/scalix/bin/sxaa merge 15036 from trunk: RM61231: Filter text contains is missing for sxaa utility Check in --contains changes on behalf of ABR, and update man page
Updated by Danny T about 2 years ago
Latest build upload (note one VM may be missing):
[sxdev@snorlax-hub scalix-12.7.1]$ ls -l */*15037* -rw-r--r-- 1 nobody nobody 17412516 Nov 19 09:51 deb8/scalix-server_12.7.1.15037_amd64.deb8.deb -rw-r--r-- 1 nobody nobody 17412484 Nov 19 09:51 deb8/scalix-server_12.7.1.15037_i386.deb8.deb -rw-r--r-- 1 nobody nobody 18022776 Nov 19 09:51 rhel7/scalix-server-12.7.1.15037-1.rhel7.i386.rpm -rw-r--r-- 1 nobody nobody 17781436 Nov 19 09:51 rhel7/scalix-server-12.7.1.15037-1.rhel7.x86_64.rpm -rw-r--r-- 1 nobody nobody 17275529 Nov 19 09:51 sles11/scalix-server-12.7.1.15037-1.sles11.i586.rpm -rw-r--r-- 1 nobody nobody 17275637 Nov 19 09:51 sles11/scalix-server-12.7.1.15037-1.sles11.x86_64.rpm -rw-r--r-- 1 nobody nobody 17275695 Nov 19 09:51 sles12/scalix-server-12.7.1.15037-1.sles12.x86_64.rpm [sxdev@snorlax-hub scalix-12.7.1]$