About filter rules
About filter rules
Hi! I use ZCS 8.0.6 and I have a some question about filter rules.
How can I run the existing filter rule from command line? With zmmailbox I can create, modify or get filter rules, but not to run it.
My task is this: I need script for periodically check all mailboxes for mails with specific subject and from specific address, and delete if messages older than n days.
It seems to me that filter rule is most easy way to perform this job, but unfortunately I could not find anything in the documentation about commands to run the filters task.
How can I run the existing filter rule from command line? With zmmailbox I can create, modify or get filter rules, but not to run it.
My task is this: I need script for periodically check all mailboxes for mails with specific subject and from specific address, and delete if messages older than n days.
It seems to me that filter rule is most easy way to perform this job, but unfortunately I could not find anything in the documentation about commands to run the filters task.
- ccelis5215
- Outstanding Member
- Posts: 632
- Joined: Sat Sep 13, 2014 2:04 am
- Location: Caracas - Venezuela
- ZCS/ZD Version: 8.8.15.GA.3869.UBUNTU18.64 P12
About filter rules
hi Desler,
You can do your task using in two ways:
1.- Script using zmmailbox to search and delete messages based in you criteria.
2.- Using filter to move messages to a folder and then applying retention to the folder.
Let us know if you need more details.
ccelis
You can do your task using in two ways:
1.- Script using zmmailbox to search and delete messages based in you criteria.
2.- Using filter to move messages to a folder and then applying retention to the folder.
Let us know if you need more details.
ccelis
About filter rules
[quote user="ccelis5215"]hi Desler,
You can do your task using in two ways:
1.- Script using zmmailbox to search and delete messages based in you criteria.
2.- Using filter to move messages to a folder and then applying retention to the folder.
Let us know if you need more details.
ccelis[/QUOTE]
1. Unfortunately it is very slow option. When I try to use deleteConversation and deleteMessage this commands took a one or two seconds per one message.
Maybe I do something wrong but I use this syntax:
zmmailbox -z -m deleteConversation
zmmailbox -z -m deleteMessage
And as far as I know there is no way to simultaneously delete messages using this commands. Or it is wrong?
I have a very big number of letters to use deleteConversation and deleteMessage if they deleting one message per iteration.
2. My problem is that I need to use the filter not from GUI. I want to run filter from the command line. Because I hane many user accounts and want to apply filter to all users.
I can create filter by using:
zmmailbox -z -m afrl
My question - how I can run this filter from command line?
You can do your task using in two ways:
1.- Script using zmmailbox to search and delete messages based in you criteria.
2.- Using filter to move messages to a folder and then applying retention to the folder.
Let us know if you need more details.
ccelis[/QUOTE]
1. Unfortunately it is very slow option. When I try to use deleteConversation and deleteMessage this commands took a one or two seconds per one message.
Maybe I do something wrong but I use this syntax:
zmmailbox -z -m deleteConversation
zmmailbox -z -m deleteMessage
And as far as I know there is no way to simultaneously delete messages using this commands. Or it is wrong?
I have a very big number of letters to use deleteConversation and deleteMessage if they deleting one message per iteration.
2. My problem is that I need to use the filter not from GUI. I want to run filter from the command line. Because I hane many user accounts and want to apply filter to all users.
I can create filter by using:
zmmailbox -z -m afrl
My question - how I can run this filter from command line?
About filter rules
SOLVED! May it be interesting to others. There is way to run filter rule from command line:
zmsoap -z -m -f
File with request is in xml format and using ApplyFilterRules SOAP Command:
in:"inbox" OR in:"Trash"
zmsoap -z -m -f
File with request is in xml format and using ApplyFilterRules SOAP Command:
in:"inbox" OR in:"Trash"
-
- Advanced member
- Posts: 52
- Joined: Sat Sep 13, 2014 1:36 am
Re: About filter rules
May you please write an xml example I have search in google the xml format for ApplyFilterRules and what i have found is only this:Desler wrote:SOLVED! May it be interesting to others. There is way to run filter rule from command line:
zmsoap -z -m -f
File with request is in xml format and using ApplyFilterRules SOAP Command:
in:"inbox" OR in:"Trash"
<ApplyFilterRulesRequest>
<filterRules>
<filterRule name="{name}"/>+
</filterRules>
[<m ids="{msg-id-list}"/>]
[<query>{query-string}</query>]
</ApplyFilterRulesRequest>
I have tried to apply it with not success.
<ApplyFilterRulesRequest>
<filterRules>
<filterRule name="Services"/>
</filterRules>
</ApplyFilterRulesRequest>
ERROR: service.UNKNOWN_DOCUMENT (unknown document: ApplyFilterRulesRequest)
<ApplyFilterRules>
<filterRules>
<filterRule name="Services"/>
</filterRules>
</ApplyFilterRules>
ERROR: service.UNKNOWN_DOCUMENT (unknown document: ApplyFilterRules)
Where should be option in:"INBOX"?
- DanielEugenin
- Posts: 16
- Joined: Thu Sep 19, 2013 9:51 am
- Location: Chile
- ZCS/ZD Version: 9.0.0_GA_3924.RHEL7_64_202003310103
- Contact:
Re: About filter rules
Hi rojoblandino,.
I have an example without using xml file, just execute:
Where:
@name="Services" is the name of your filter created.
query => execute filter on /Inbox folder
I have an example without using xml file, just execute:
Code: Select all
zmsoap -z -m user@domain.com ApplyFilterRulesRequest/filterRules/filterRule @name="Services" ../../query="in:/Inbox"
@name="Services" is the name of your filter created.
query => execute filter on /Inbox folder
-
- Advanced member
- Posts: 52
- Joined: Sat Sep 13, 2014 1:36 am
Re: About filter rules
DanielEugenin wrote:Hi rojoblandino,.
I have an example without using xml file, just execute:
Where:Code: Select all
zmsoap -z -m user@domain.com ApplyFilterRulesRequest/filterRules/filterRule @name="Services" ../../query="in:/Inbox"
@name="Services" is the name of your filter created.
query => execute filter on /Inbox folder
It is Perfect!
That is what i was looking for, Thanks!
Re: About filter rules
Hello
Found here very useful command, but here is problem
zimbra@mail:/root$ zmsoap -z -m username@mail.server.com ApplyFilterRulesRequest/filterRules/filterRule @name="2012" ../../query="in:/Inbox"
ERROR: service.INVALID_REQUEST (invalid request: Attempted to apply filter rules to 95053 messages, which exceeded the limit of 10000)
Is that any way to change this limit?
8.6.0_GA_1153.FOSS
Found here very useful command, but here is problem
zimbra@mail:/root$ zmsoap -z -m username@mail.server.com ApplyFilterRulesRequest/filterRules/filterRule @name="2012" ../../query="in:/Inbox"
ERROR: service.INVALID_REQUEST (invalid request: Attempted to apply filter rules to 95053 messages, which exceeded the limit of 10000)
Is that any way to change this limit?
8.6.0_GA_1153.FOSS
Re: About filter rules
This will do it, change "default" to your COS:bioroido wrote:Hello
Found here very useful command, but here is problem
zimbra@mail:/root$ zmsoap -z -m username@mail.server.com ApplyFilterRulesRequest/filterRules/filterRule @name="2012" ../../query="in:/Inbox"
ERROR: service.INVALID_REQUEST (invalid request: Attempted to apply filter rules to 95053 messages, which exceeded the limit of 10000)
Is that any way to change this limit?
8.6.0_GA_1153.FOSS
zmprov mc default zimbraFilterBatchSize 2000000
-
- Posts: 2
- Joined: Wed Jan 12, 2022 4:38 pm
Re: About filter rules
Daniel, thanks for the brilliant idea!DanielEugenin wrote:Hi rojoblandino,.
I have an example without using xml file, just execute:
Where:Code: Select all
zmsoap -z -m user@domain.com ApplyFilterRulesRequest/filterRules/filterRule @name="Services" ../../query="in:/Inbox"
@name="Services" is the name of your filter created.
query => execute filter on /Inbox folder
Don't you know if there is the way to apply ALL active rules that user has? Rules in my case can be added or removed by user without notifications.
TIA