use of com.zimbra.cs.filter.jsieve.ActionExplicitKeep in project zm-mailbox by Zimbra.
the class ZimbraMailAdapter method executeAllActions.
/**
* Execute the list of actions which have been stacked during the evaluation
* of the each sieve script.
* @throws SieveException
*/
public void executeAllActions() throws SieveException {
try {
handler.beforeFiltering();
String messageId = Mime.getMessageID(handler.getMimeMessage());
// the script contains a single discard action, JSieve returns an empty list.
if (this.discardActionPresent) {
ZimbraLog.filter.info("Discarding message with Message-ID %s from %s", messageId, Mime.getSender(handler.getMimeMessage()));
}
if (getActions().size() == 0) {
handler.discard();
return;
}
detectExplicitKeep();
for (Action action : actions) {
if (action instanceof ActionKeep) {
executeActionKeepInternal();
} else if (action instanceof ActionExplicitKeep) {
keep(KeepType.EXPLICIT_KEEP);
} else if (action instanceof ActionFileInto) {
executeActionFileIntoInternal(action);
} else if (action instanceof ActionRedirect) {
executeActionRedirectInternal(action);
} else if (action instanceof ActionReply) {
executeActionReplyInternal(action);
} else if (action instanceof ActionNotify) {
executeActionNotifyInternal(action);
} else if (action instanceof ActionReject) {
executeActionRejectInternal(action);
} else if (action instanceof ActionEreject) {
executeActionErejectInternal(action);
} else if (action instanceof ActionNotifyMailto) {
executeActionNotifyMailto(action);
}
}
handler.afterFiltering();
} catch (ServiceException e) {
throw new ZimbraSieveException(e);
}
}
Aggregations