-
What does the 'Define Rules' screen let me do?
The 'Define Rules' screen lets you setup rules to control
what happens when email is delivered to your account. There
are several sections to the screen:
- Rejecting emails - allows you to reject emails sent to you
based on some criteria.
- Filing emails - allows you to file emails sent to you into
different folders based on some criteria.
- Vacation notification - respond to emails with a 'vacation
response'
- Forwarding - allows you to forward emails to another email
address based on some criteria.
The rules from all sections are combined together when processing
incoming emails.
Top
-
I changed some rules on the 'Define Rules' screen, but they don't work?
When you make any changes on the 'Define Rules' screen, you
must make sure you click the 'Done' button at the top of the
screen. Clicking 'Back' in your browser or the 'Cancel' button
will not work. The 'Done' button forces a rebuild of the internal
rules script, which is what OKmail actually uses. See
this for more details.
Top
-
I want to create some more complex set of rules. What can I do?
Internally, OKmail actually uses the powerful 'sieve'
filtering language. The 'Define Rules' screen just provides an
easier way to build this sieve script. You can however directly
edit this script to create more complex rule sets. To do this,
you click the 'View filter source' link at the bottom of the
'Define Rules' screen.
For more details on sieve, see:
Top
-
Um, not quite that complex!
We do support slightly more complicated behaviour than is
accessible on the Rules screen, but you need some incantations
in the 'Text' field to trigger it.
NOTEUsing any of these forms in the 'Text' field
will cause the 'That' drop down to be ignored. Because of this
it will be replaced with a text string next time you load the page.
If you specify '|pattern|', then 'pattern' will be treated
like a glob pattern, rather than plain text. In a glob pattern,
you can use * to match any number of characters, and ? to match
a single character.
The glob match is 'anchored' at the beginning and end of the
header, so '|*word*|' is equivalent to 'Contains' 'word', and
'|word|' is equivalent to 'Is exactly' 'word'.
-
If you specify '/pattern/', then 'pattern' will be treated
like a regular expression pattern, rather than plain text.
Note that you can just enter a normal regular expression here,
you don't have to "double backslash" like you would if you
were writing the sieve script directly.
Note also that POSIX EREs are supported, but NOT PCREs.
If you don't know what a 'regular expression' is, you're probably
better off sticking with glob patterns. If you'd like to learn
about regular expressions,
try
clicking here to consult Wikipedia.
-
If you specify '!|pattern|' or '!/pattern/', then pattern is
treated like a glob or regular expression as appropriate, and
the ENTIRE RULE is negated.
For example, if you select 'Any Header', and specify '!|*example*|'
then this will only match against messages that do not contain
the word 'example' in any header. If a single header contains
'example' then the rule will not match against that message.
Note that the * at either end are important if you just want to
test that some text doesn't occur anywhere in the specified headers.
Likewise, remember that only THIS rule is negated. For example,
if you attempt to build a whitelist with multiple reject
rules, 'From' - '!|*myfriend*|' and 'From' - '!|*myotherfriend*|'
then all mail will be rejected. The first rule will reject mail from
'myotherfriend@example.com', and the second rule will reject
mail from 'myfriend@example.com'. That's bad!
Be careful using this. It's easy to accidentally filter all your
mail away, if you haven't considered all the angles.
Top
-
What does the 'Message with' part of Define Rules mean?
When an e-mail is sent it consists of two parts, a 'Headers' and a
'Body'. The Body is the part with the actual message, the headers are
the part where information like sender, recipient, date and time of
sending and what server it was sent through, among other things. The
Rules for filtering mail work by looking through these headers to
see if there is a match with any of the rules. The various options in
'Message with' each examine a different part of the headers.
- Subject
- Looks in the Subject part of the headers, this is the subject
that you see in the Mailbox view.
- To/CC
- Looks in the 'To' or 'CC' part of the headers. 'To' is the address
the mail was sent to, this can be your account, but it can also be an
alias, a pop-link you retrieved a mail from or a subdomain-addressing
address. CC means Carbon Copy, and can be used to specify additional
recipients of an e-mail. It's combined with To since essentially
they mean the same.
- From
- Looks in the 'From' part of the header. This is used to determine
who sent the e-mail, and allows you to sort and filter mail depending
on the sender.
- Any header
- Looks through all the headers. Be careful with this one, as there
are a lot of headers, including things like servers an e-mail passed
through. It is very easy to make a rule that accidentally has a lot
more positives than you intended.
- Envelope
- This is pretty advanced stuff. The Envelope is the 'real'
source of the mail. All the other headers are created by the
e-mail client someone uses. The envelope is created by the e-mail
server. This is particularly useful for filtering mailing-lists
and mails where you are addressed through the BCC field, as there
won't be a TO: field to filter for.
- Advanced
- Advanced is not really a header, but it allows you to filter
for anything you want in the headers. For example, if you receive
mails that have a very strange characterset and you wish to set
those aside in another folder, you can use this filter.
Important:You will need to understand the 'sieve' mail
filtering language before you use this filter type as the contents
are passed directly into a 'sieve' "if" clause. If you don't
know 'sieve', do not use this filter type, as it may stop all your
rules from working.
- Always
- This matches any email that comes across this rule. Use this
if you want to apply the current rule for all emails that gets to
this rule.
- Body
- This will look for the match in the body of the email.
Top
-
What does the 'Order' column in the 'Define Rules' screen do?
The 'Order' column allows you to specify in which order you
want the rules to be applied. If you have multiple rules with the
same 'Order' value, they get applied in the order they appear in the
'Define Rules' page. But if you specify a value for the 'Order' field,
rules with a lower 'Order' value will be applied before rules with a
higher 'Order' value. This is very useful for sometimes an e-mail
might trigger several rules. In that case it's important that you
have the 'Order' set up correctly.
For example, if you want to filter all mail containing 'Foo' in the
subject to Folder A, and you want all mail from 'Bob' to be filed in
Folder B you'd make two rules for that (Subject 'Foo' into folder A,
and From 'Bob' into folder B). This would work perfectly until Bob
sends you an email with 'Foo' in the subject. Now what? Well, in that
case it would be smart to have the Order working. If the rule to file
mail from 'Bob' into the folder B has the lower Order value, your mail
will end up in folder B. Similarly, if the rule to file mail with 'Foo'
in the subject into folder A has the lower Order value, your mail will
end up in folder A.
Top
-
What does the 'Forward type' column in the 'Define Rules' screen do?
The 'Forward type' column allows you to specify how the message will
be sent to the destination specified in the 'Forward to' column. The
following types are available:
- 'Redirect message', the default type, sends an exact copy of the message
including the leaving the original sender in the From address intact and
unchanged to the email address specified in the 'Forward to' field. If you just
want to forward the message to another email account, this is probably what you
want.
- 'Redirect summary' extracts the text of the message (ie, without any
attachments or formatting) and sends a notification containing the first 160
characters to the email address specified in the 'Forward to' field. The
From address of the summary message is the same as the From address in the
original message.
- 'Redirect squeezed summary' is the same as 'Redirect summary,' except
that it uses a compression algorithm to squeeze the text of the message down to
a smaller size, while still allowing it to be read. If you would like a (technical)
description of the compression algorithm, or to see an example of what compressed
text may look like, see the DESCRIPTION section of
this page.
- 'Forward summary' similar to 'Redirect summary', but the From
address used on the notification email is your default personality, but the subject
will be modified to include the sender of the original message.
- 'Forward squeezed summary' same as 'Forward summary', but using
the same compression as 'Redirect squeezed summary.'
- 'Notification only' an email is sent to the 'Forward to' address
with a message body that says only that a new email has arrived, and the From address
of the new email.
- 'SMS summary' is like 'Forward summary' but assumes that the 'Forward to'
column will contain a full mobile telephone number (including country code) instead
of an email address. It then sends the notification to that phone via SMS. As with
all SMS messages, the originator is the Mobile Number of the default personality for
the account.
- 'SMS squeezed summary' is like 'Forward squeezed summary' but, again,
expects a mobile telephone number in the 'Forward to' column.
- 'SMS subject' sends an SMS message containing only the first 160
characters of the subject of the triggering email. The 'Forward to' column must be a
full mobile telephone number (including country code).
- 'Custom' directly inserts the text in the "Forward to" field into the
sieve script. This means you need to include the notify command and all parameters
you plan to pass to it. See the sieve documentation for more information. Some examples:
notify :method "mailto" :options ["joeblogs@hotmail.com","From","Orig"] :message "$from$ / $subject$ / $text$"
notify :method "sms" :options ["123456789","Squeeze","High"] :message "$from$ / $subject$ / $text$"
If you are using either 'SMS summary', 'SMS squeezed summary' or 'SMS subject',
ensure that the 'Forward to' column contains a mobile telephone number. You must
include the country and area code in the number, and you will need to have purchased
enough SMS Credits to pay for the SMS messages that will be sent. For more information
on purchasing SMS Credits, see
Paying for SMS messages.
Top
-
Can I forward only part of a message as an SMS?
Yes. You have to use the "Custom" forwarding mechanism
as described here to
create a custom notify call.
To forward only the first N characters of a message, you
can specify $text[N]$ in the :message parameter. So for instance
to forward only the first 50 characters of a message to the mobile
number 12345689, you can use:
notify :method "sms" :options ["123456789"] :message "$from$ / $subject$ / $text[50]$"
You can also extract part of a message based on a regular expression
to use as the forwarding text. To do that, you use a special construct
of the form below before the $text$ parameter.
extract{{regular-express-with-capturing-()'s}}
So for instance, say you receive messages which contain stock quotes,
but the messages contain a pre-amble you don't want to forward. You
do know that just before the actual quote portion of the email, there
is the text "Your stock quote is" and then the actual quote. Using
a regular expression, you can capture the text after that string, and
forward only it. That would be done with a rule like:
notify :method "sms" :options ["123456789"] :message "$from$ / $subject$ / extract{{Your stock quote is(.*)}} $text$"
The text captured in the (.*) capture is what will be forwarded.
Additional notes on using this:
- Only 1 capture is permitted
- If the match fails, the entire text part is forwarded still
- The regexp is in "single-line" mode, so . will match any character, including newlines
- The regexp is also in "multi-line" mode, so ^ and $ match start and end of line anywhere this is a \n, not just the start and end of the message string
Top
-
What's the order of Sieve rules automatically generated by Rules screen forms?
The following screens currently generate rules that appear in the final
sieve script for your account.
- Spam/Virus Protection - All settings (except Possible Spam settings) produce Sieve code.
- Personalities - Sent Items on SMTP setting (currently only on Beta server) produces Sieve code.
- POP Links - File into folder (if different than Inbox) produces Sieve code.
- Define Rules - All settings produce Sieve code.
The screens above automatically create Sieve code in the following
order. If no rule is activated, the message by default is filed in
the Inbox by the implicit keep.
- SMTP filing - Each Personality which has SMTP filing
to folder active generates Sieve code examining the x-resolved-to
header looking for +personalitysentitem- followed by a unique
number for that personality in your account. There is one of these
clauses per Personality which has SMTP filing active. This code is
ignored on incoming external messages, and is only executed when
the account sends a message. Sieve execution is stopped after the
filing action.
- Secret word - If found in "to", "cc", or "subject",
then the following six sections are skipped: Rejecting emails,
Maximum size, Whitelisting, Backscatter filtering, Definite Spam,
and Probable Spam.
- Rejecting emails clauses - If a match is found, the
message is either rejected with the bounce message "Message bounced
by server content filter" or silently discarded, and Sieve execution
is stopped.
- Maximum size - If the message size is exceeded, the
message is rejected with the bounce message "Message not delivered;
size over limit accepted by recipient", or if the settings are "Move
to folder" and the Folder is set to <Reject> the message is
silently discarded, or if the Folder is set otherwide the message
is filed in that folder. If the message size was exceeded, Sieve
execution is stopped after these actions.
- Whitelisting - If the sender is whitelisted (exact address
or *@domain appears in the online address book), then the following
three sections (Backscatter filtering, Definite Spam, and Probable
Spam) are skipped.
- Backscatter filtering - If the sender is not whitelisted
by the address book, then the backscatter rules are executed, and
Sieve execution is stopped after these actions.
- Definite Spam - If the sender is not whitelisted by the
address book, then the Definite Spam rule is executed (which can
discard the message), and Sieve execution is stopped after these
actions.
- Probable Spam - If the sender is not whitelisted by the
address book, then the Probable Spam rule is executed, which can
file the message (normally in Junk Mail), and Sieve execution is
stopped after these actions.
- Bypass File into Folders for Mailing Lists - If this
parameter is found in "TO" or "CC", then the next two sections
(File into folders and POP links filing) are skipped.
- File into folders - If this test is satisfied, the message
(optionally flagged) is filed into a specified folder and the next
section (POP links filing) is skipped.
- POP links filing - If the message was obtained from a
POP link, then the filing rule on the POP Links screen is executed,
and Sieve execution continues to the next step.
- Automatic notification (vacation message) - If the incoming
message was sent to an address set up on the Personalities screen,
then the vacation message is executed, and Sieve execution continues
to the next step.
- Forwarding - The forwarding rules are executed.
Top
-
How do I tell what address an email was delivered to?
When an email is sent as 'Bcc', there are no header fields
which show the exact address the email was sent to. There are
however a number of fields added as the email is processed.
The delivery process is described
here. You can use
these extra delivery details to filter emails sent to a Bcc
address.
Top