Feature #61231

Filter text contains is missing for sxaa utility

Added by Alexey Bobyr 5 months ago. Updated 4 months ago.

Status:In ProgressStart date:11/02/2018
Priority:NormalDue date:
Assignee:ServerDevsGroup% Done:
0%
Category:Scalix Server
Target version:12.7.1
Operation System:--
Milestones:

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 --retain --contains "e-mail contains this text"

sxaa.diff Magnifier (4.08 KB) Alexey Bobyr, 11/09/2018 12:10 AM

sxaa (28.4 KB) Alexey Bobyr, 11/09/2018 12:10 AM

History

#1 Updated by Alexey Bobyr 5 months ago

  • Description updated (diff)

#2 Updated by Danny T 5 months ago

  • Status changed from New to In Progress

Thanks, I will roll in your changes to 12.7.1 and merge to 13.

#3 Updated by Danny T 4 months 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?

#4 Updated by Alexey Bobyr 4 months 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 <> wrote:
Issue #61231 has been updated by Danny T.

Alexey, I am about to commit your sxaa.py change, but this bit looks a bit odd: #
  1. 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 &#34;Sam Orr&#34; --file &#34;JUNK&#34; --subject &#34;SPAM&#34; 
sxaa --user &#34;Sam Orr&#34; --file &#34;dave&#34; --sender &#34;dave&#64;example.com&#34;
sxaa --user &#34;Sam Orr&#34; --file &#34;Spam?&#34; --header &#34;X-Spam-Status:***&#34;
sxaa --user &#34;Sam Orr&#34; --file &#34;Sched&#34; --itemclass &#34;IPM.Schedule&#34;
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 &#34;USER1&#34; --redirect USER2&#64;site.com --retain --contains &#34;e-mail contains this text&#34;
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

#5 Updated by Alexey Bobyr 4 months ago

  • File deleted (sxaa)

#6 Updated by Alexey Bobyr 4 months ago

  • File deleted (sxaa.diff)

#7 Updated by Alexey Bobyr 4 months 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"

#8 Updated by Danny T 4 months 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 ...

#9 Updated by Danny T 4 months 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

#10 Updated by Danny T 4 months 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

#11 Updated by Danny T 4 months 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]$

Also available in: Atom PDF