Rules allow you to define actions applied to messages being downloaded.
Using the Rules, you can create mechanisms for performing certain actions when messages are downloaded from server. This is all defined once, and then performed on every new message that matches defined conditions.
List of Rules
There is a list of Rules saved in a file. All rules together define all possible filtering performed on messages. Downloaded message is checked against all Rules in the list, in the order how they are defined. All actions of all matching Rules are then executed, in the order how they are defined.
Single Rule define list of one or more Conditions, and one or more Actions. Rule may be enabled or disabled. Disabled Rule is ignored when looking for matching rules.
A Rule may be defined to match all messages, in such case there are no conditions to be checked, and the Rule (if it is enabled) is always executed on all new messages.
One Rule may be applied to all accounts (default), or only chosen accounts. If account is not enabled for Rule, then messages downloaded from that account never match the Rule.
Conditions are the criteria checked on message in order to decide if Rule applies to the message.
Conditions is a list of one or more checks. If there are more conditions in the list, there is logical operation among them, which may be AND or OR. The operator implies if all conditions (AND operator) or any condition (OR operator) in the list must be true in order for Rule to be selected.
Nested logical groups
Due to logical operator among conditions (AND/OR), the condition list may contain nested group of conditions with different logical operator (AND/OR). This way, it is possible to create complex conditions such as: “IF sender contains abc AND (subject contains def OR subject contains ghi) THEN …”. The nested group of conditions is evaluated first as a whole, then result is evaluated on main condition group.
Conditions is a definition of check performed on a message. There’s WHAT is being checked (e.g. subject, message size, etc), then there’s logical OPERATOR such as “IS/CONTAINS/STARTS WITH/etc”, these operators depend on type of WHAT. Finally there may be PARAMETER to check for, which may be text or number (or nothing for some condition types).
Example of condition: it is possible to check if message subject starts with some text.
Following conditions are defined:
- Subject text-op text
- Sender text-op text
- Sender is / is not in Contacts
- Recipient text-op text
- Size numeric-op number (KB)
- Age numeric-op number (days)
- Header name text-op text
text-op is operation on text, such as: contains, does not contain, starts with, ends with, is, is not or RegExp.
numeric-op is operation on number: less then, more than.
is/is not checks if parameter is contained somewhere (e.g. Sender in Contacts).
Condition on message headers
Conditions made on message headers have two parameters – header name, and text to be searched. The operator is text-op as defined above.
Because ProfiMail does not store all message headers on device, condition on headers is only checked during downloading new messages, when message headers are available as part of message downloading. Header conditions are not checked when previewing Rule in editor, or when Rule is manually run.
Each Rule can define one or more actions to be performed on message when the Rule is applied. All defined actions are executed.
Some actions have parameter, such as which sound to play. Other actions don’t have any parameter.
Following actions are defined:
- Set color changes color of message when displayed in Message list
- Delete deletes the message
- Download only header will cause only message header be downloaded (not body)
- Download full message will cause only message header and its body be downloaded
- Hide will hide the message
- Mark as read/unread will change the message’s read status to given type
- Set starred will set star on message
- Play sound will play selected sound type when the message is received (may be also Silent, in which case message won’t make sound notification)
- Move to folder will move the message to selected folder
- Forward will forward (send) the message to specified email address
- Don’t search more rules will cause this rule to be final, no more rules below it will be run on given message