Search in sources :

Example 26 with ZFilterRules

use of com.zimbra.client.ZFilterRules in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doModifyOutgoingFilterRule.

private void doModifyOutgoingFilterRule(String[] args) throws ServiceException {
    ZFilterRules rules = mMbox.getOutgoingFilterRules(true);
    doModifyFilterRule(args, rules);
    mMbox.saveOutgoingFilterRules(rules);
}
Also used : ZFilterRules(com.zimbra.client.ZFilterRules)

Example 27 with ZFilterRules

use of com.zimbra.client.ZFilterRules in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doModifyIncomingFilterRule.

private void doModifyIncomingFilterRule(String[] args) throws ServiceException {
    ZFilterRules rules = mMbox.getIncomingFilterRules(true);
    doModifyFilterRule(args, rules);
    mMbox.saveIncomingFilterRules(rules);
}
Also used : ZFilterRules(com.zimbra.client.ZFilterRules)

Example 28 with ZFilterRules

use of com.zimbra.client.ZFilterRules in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doAddOutgoingFilterRule.

private void doAddOutgoingFilterRule(String[] args) throws ServiceException {
    ZFilterRules rules = mMbox.getOutgoingFilterRules();
    doAddFilterRule(args, rules);
    mMbox.saveOutgoingFilterRules(rules);
}
Also used : ZFilterRules(com.zimbra.client.ZFilterRules)

Example 29 with ZFilterRules

use of com.zimbra.client.ZFilterRules in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doAddIncomingFilterRule.

/*
    addFilterRule(afrl)
  --before {existing-rule-name}
  --after {existing-rule-name}
  --first
  --last

  {name}  [*active|inactive] [any|*all] {conditions}+ {actions}+
    */
private void doAddIncomingFilterRule(String[] args) throws ServiceException {
    ZFilterRules rules = mMbox.getIncomingFilterRules();
    doAddFilterRule(args, rules);
    mMbox.saveIncomingFilterRules(rules);
}
Also used : ZFilterRules(com.zimbra.client.ZFilterRules)

Example 30 with ZFilterRules

use of com.zimbra.client.ZFilterRules in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doGetIncomingFilterRules.

private void doGetIncomingFilterRules() throws ServiceException {
    ZFilterRules rules = mMbox.getIncomingFilterRules(true);
    printFilterRules(rules);
}
Also used : ZFilterRules(com.zimbra.client.ZFilterRules)

Aggregations

ZFilterRules (com.zimbra.client.ZFilterRules)48 ZFilterAction (com.zimbra.client.ZFilterAction)37 ZFilterCondition (com.zimbra.client.ZFilterCondition)37 ZFilterRule (com.zimbra.client.ZFilterRule)37 ArrayList (java.util.ArrayList)35 ZMessage (com.zimbra.client.ZMessage)28 Test (org.junit.Test)23 ZHeaderCondition (com.zimbra.client.ZFilterCondition.ZHeaderCondition)20 ZTagAction (com.zimbra.client.ZFilterAction.ZTagAction)13 ZMarkAction (com.zimbra.client.ZFilterAction.ZMarkAction)10 ZFileIntoAction (com.zimbra.client.ZFilterAction.ZFileIntoAction)9 ZMailbox (com.zimbra.client.ZMailbox)9 HashSet (java.util.HashSet)5 ZBodyCondition (com.zimbra.client.ZFilterCondition.ZBodyCondition)4 ZTag (com.zimbra.client.ZTag)4 ZDiscardAction (com.zimbra.client.ZFilterAction.ZDiscardAction)3 ZRedirectAction (com.zimbra.client.ZFilterAction.ZRedirectAction)3 ZKeepAction (com.zimbra.client.ZFilterAction.ZKeepAction)2 ZRFCCompliantNotifyAction (com.zimbra.client.ZFilterAction.ZRFCCompliantNotifyAction)2 ZFolder (com.zimbra.client.ZFolder)2