Class BlueMindRules
MailFilterRule,
master 302bc396), both ways, and the marker eXo finds its rules by.
The marker. Every rule eXo writes carries client "exo",
which BlueMind's webmail does not list, and in its
clientProperties the kind "server-rule" under "exoKind"
and eXo's reference under "exoRef". A rule without both is not
eXo's, whatever its client: it is never read as eXo's, nor written, nor
removed.
The vocabulary, as the live run on BlueMind 5.6.4 accepted and kept
every form (EXO-90801): the conditions are one AND group of leaves,
each joining the one before it by AND for "all" or OR for
"any" (BlueMind ignores the first leaf's join, eXo writes it too so that
"all" or "any" reads back from a single condition); text compares are
BlueMind's CONTAINS with CASE_INSENSITIVE, a sub-string, the
whole value or a prefix, and "does not contain" is the negated sub-string;
"ends with" and "is in the domain" are BlueMind's globs
(MATCHES), which have no escape for * and ? and
compare case (WildcardMatcher, master 302bc396): unlike the Sieve
engine's, they miss a sender whose domain is written with a capital letter
-- the domain eXo is given is lower-cased -- and a subject ending the same
text in another case; a size is a RANGE on the size in bytes, bounds excluded;
a mailing list is one of the three list headers present; an automated mail
has an Auto-Submitted header other than no. A move names
the folder by BlueMind's internalId and its full name, as the webmail
writes it; Junk and Trash are moves to the default folder by name, never
MARK_AS_DELETED, which expunges; a star is
MARK_AS_IMPORTANT; a tag is SET_FLAGS with the keyword; a
forward is REDIRECT with a copy kept.
Reading back accepts exactly those forms, and a rule's reading goes
through ServerRule.validated() again: anything else is a rule eXo
does not read, never one it guesses.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe client every rule eXo writes carries.static final StringThe prefix BlueMind's delivery reads as a parameter to replace, not a text to compare (ParameterValueCoreProvider, master 302bc396).static final StringTheclientPropertieskey holding the type of the rule's filing action.static final StringTheclientPropertieskey holding the eXo key of the folder the rule files into.static final StringThe kind of every server rule eXo writes.static final StringTheclientPropertieskey holding the kind of eXo rule.static final StringTheclientPropertieskey holding eXo's reference of the rule.static final StringWhy a value is refused: BlueMind replaces a value with this prefix at delivery.static final StringThe client of the rules BlueMind's own webmail writes and lists.static final StringWhy a value is refused: BlueMind's globs cannot hold a*or a?as text. -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringhash(List<BlueMindExoRule> rules) The SHA-256 of eXo's rules as BlueMind holds them, in order: each rule's JSON with its members sorted and its id left out, so that a renumbering changes nothing and any change to a rule does.static booleanisActiveWebmailRule(tools.jackson.databind.JsonNode json) Whether a rule as BlueMind answered it is one of the webmail's own that runs on incoming mail: what the user sees and edits in BlueMind's webmail (filterRules.ts: client "bluemind", triggerIN, not deferred), generic, and switched on.static booleanisExos(tools.jackson.databind.JsonNode json) Whether a rule as BlueMind answered it carries eXo's marker.static tools.jackson.databind.node.ObjectNodetoBlueMind(org.exoplatform.emailConnector.model.ServerRule rule, List<org.exoplatform.bluemind.client.model.BlueMindMailFolder> folders) The rule eXo writes for one of its server rules: the marker, the conditions and the actions in BlueMind's model.static BlueMindExoRuletoExoRule(tools.jackson.databind.node.ObjectNode json) One of eXo's rules as BlueMind answered it, read back.
-
Field Details
-
CLIENT
The client every rule eXo writes carries.- See Also:
-
WEBMAIL_CLIENT
The client of the rules BlueMind's own webmail writes and lists.- See Also:
-
REF_KEY
TheclientPropertieskey holding eXo's reference of the rule.- See Also:
-
KIND_KEY
TheclientPropertieskey holding the kind of eXo rule.- See Also:
-
KIND
The kind of every server rule eXo writes.- See Also:
-
FILING_KEY
TheclientPropertieskey holding the type of the rule's filing action.- See Also:
-
FOLDER_KEY
TheclientPropertieskey holding the eXo key of the folder the rule files into.- See Also:
-
WILDCARD_VALUE
Why a value is refused: BlueMind's globs cannot hold a*or a?as text.- See Also:
-
RESERVED_VALUE
Why a value is refused: BlueMind replaces a value with this prefix at delivery.- See Also:
-
DYNAMIC_PREFIX
The prefix BlueMind's delivery reads as a parameter to replace, not a text to compare (ParameterValueCoreProvider, master 302bc396).- See Also:
-
-
Method Details
-
toBlueMind
public static tools.jackson.databind.node.ObjectNode toBlueMind(org.exoplatform.emailConnector.model.ServerRule rule, List<org.exoplatform.bluemind.client.model.BlueMindMailFolder> folders) throws org.exoplatform.emailConnector.exception.ServerRuleUnsupportedException The rule eXo writes for one of its server rules: the marker, the conditions and the actions in BlueMind's model.- Parameters:
rule- the rule, validated, its reference setfolders- the mailbox's folders, needed when the rule moves mail to a folder of the user's; null otherwise- Returns:
- the rule, as BlueMind's JSON object
- Throws:
org.exoplatform.emailConnector.exception.ServerRuleUnsupportedException- when a value cannot be written as text in BlueMind's modelIllegalArgumentException-emailConnector.rules.folder.unresolvedwhen the folder a move names is not in the mailbox
-
isExos
public static boolean isExos(tools.jackson.databind.JsonNode json) Whether a rule as BlueMind answered it carries eXo's marker.- Parameters:
json- the rule- Returns:
- true for client "exo", kind "server-rule" and a valid reference
-
toExoRule
One of eXo's rules as BlueMind answered it, read back.- Parameters:
json- a ruleisExos(tools.jackson.databind.JsonNode)accepts- Returns:
- the rule; its reading is null when it is not a form eXo writes
-
isActiveWebmailRule
public static boolean isActiveWebmailRule(tools.jackson.databind.JsonNode json) Whether a rule as BlueMind answered it is one of the webmail's own that runs on incoming mail: what the user sees and edits in BlueMind's webmail (filterRules.ts: client "bluemind", triggerIN, not deferred), generic, and switched on.- Parameters:
json- the rule- Returns:
- true for an active webmail rule
-
hash
The SHA-256 of eXo's rules as BlueMind holds them, in order: each rule's JSON with its members sorted and its id left out, so that a renumbering changes nothing and any change to a rule does.- Parameters:
rules- eXo's rules, in BlueMind's order- Returns:
- the hex digest; null when there is none
-