Download rules are a set of conditions which can be used to control which messages get downloaded, which don't and other functions like message redirection. This can be useful for preventing the download of "junk" email messages.
Download rules are enabled if all the following criteria are met:
1. You are downloading messages using POP3 (for downloading using SMTP see SMTP Rules)
2. You have specified that download rules are processed (you do this from the In Mail Configuration Page).
3. You have a valid Download Rules definition. The format of this is described below.
Note: If you do enable download rules, then connections will generally take longer (but they may save lots of time if you get "junk" email). This is because (as well as the small amount of extra processing time involved), VPOP3 has to download the message header first of all, and then download the whole message (including the header again) if the download rules say that the message should be downloaded.
REMEMBER, you MUST have turned on Use Download Rules on the In Mail configuration page for Download Rules to work.
There are fourteen actions to perform on download rules:
Delete the message (*) This deletes the message instantly (and informs the intended recipient or the ‘Main Administrator’ that this has happened). Example
*Delete message
From: bob@spammers.net
The message is deleted from the ISP POP3 mailbox and a warning message
is sent to the originally intended recipient(s)
Delete Silently (@) This deletes the message instantly, and doesn't tell anyone about it (use with caution!). Example
@Delete Silently
Subject: sex
The message is deleted from the ISP POP3 mailbox, and no one is told about it
Ignore the message (~) This just totally ignores the message (apart from deleting it after the specified number of days for leaving mail on the server). Example
~Ignore
Subject: viagra
The message is ignored and left on the ISP POP3 mail server, but not downloaded. No one is told about it.
Download (<) This will simply download the message as normal. This is the default behaviour if no other rules match. Example
<Download important
messages
From: boss@customer.com
The message is downloaded and delivered as normal
Download and Delete (%) This will download the message as normal, and then delete it immediately afterwards. Example
%Download and delete big
messages
size: 1000000
The message is downloaded from the ISP, delivered as normal, and then deleted from the ISP POP3 server.
Ask to download (?) This is a very useful option. Here, if a message matches the rule, then a copy of the header is sent to the intended recipient(s) with a message from ‘Mailer_Daemon’. If the recipient replies to this message (including the same subject line), then the message will get downloaded at the next connection. The recipient can also request an immediate deletion of the message by responding with a message beginning with the word 'DELETE'. Otherwise the message will remain on the server for the Query Download Delay setting (unless the ISP server deletes it first) before being deleted.
Redirect Ask to download (>..?) This is similar to the above option, but you can specify another user to receive the query message from Mailer_Daemon. (Note that if this user replies, the original recipient will receive the message after it is downloaded, the person receiving the query will not receive the full message.
Redirect Delete (>..*) This is similar to the Delete option, but the message indicating that the message has been deleted can be redirected to a different user.
Redirect (>..<) This will cause the message to be download, but sent to a different recipient from normal. This facility can be used to implement basic message filtering.
Redirect Download and Delete (>..%) This is similar to the Download And Delete option, but the downloaded message is redirected to a different user.
Copy Ask to download (>+..?) This is similar to the Ask to download option, but you can specify another user to receive the query message from Mailer_Daemon as well as the intended recipient. (Note that if this user replies, the original recipient will receive the message after it is downloaded, the person receiving the query will not receive the full message.
Copy Delete (>+..*) This is similar to the Delete option, but the message indicating that the message has been deleted can be copied to a different user as well as the intended recipient.
Copy (>+..<) This will cause the message to be download, but copied to a different recipient as well as the originally intended recipient.
Copy Download and Delete (>+..%) This is similar to the Download And Delete option, but the downloaded message is copied to a different user as well as the originally intended recipient.
Note that the Redirect and Copy rules can be used to redirect/copy the downloaded message to a list as well as to a single user. Starting with VPOP3 2.1.2 they also support 'FileInto' functionality to put the message into a specified IMAP4 or WebMail folder either for a specific user or for the original recipients.
To define download rules, go to the External Mail -> In Mail page and press the Edit Download Rules button (alternatively you can create or edit a text file called DLRULES.DAT in the VPOP3 directory).
Here’s a description of the file format:
Comment lines start with a #
Blank lines are ignored
The file contains zero or more Rules.
One Rule
Definition line (containing the Rule Action and Name - indicating
what happens if the rule is triggered),
More on Rule Definitions
The Rule definition line optionally starts with a ‘+’ sign. If the ‘+’ is present, then the rule is an OR rule - that means that if at least one of the conditions matches, then the rule triggers. If the ‘+’ is not present, then the rule is an AND rule - all the conditions must match for the rule to trigger.
After the optional + sign, there is another character which indicates the action which VPOP3 should take if the rule is triggered. In the list of possible actions above, this is the red character(s) in parentheses given with the action description (eg for the 'Delete' rule, it is an asterisk (*))
The name of the rule starts immediately after the *, @, ~, <, %, or ?. The name is only used for reporting purposes.
*This is a Delete Rule
The exceptions to this are the Redirect and Copy rules. In this case, the name of the real recipient immediately follows the ‘>’ character or '>+' characters, and is terminated by a ‘<’, '?', '%'' or '*'. For instance:
>recipient<This is a Redirect rule
>+recipient<This is a Copy rule
Starting with VPOP3 2.1.2, with the Redirect and Copy rules, you can also specify a 'File Into' action to put the message into a specified IMAP4 (VPOP3 Enterprise only) or WebMail folder. This is done by placing a space before the folder name either after the recipient or instead of the recipient. For instance:
>recipient folder<Put the message into a specific folder of a specific recipient
> folder<put the message into a specific folder of the original recipients
When a rule is triggered which involves a notification message (eg Ask or Delete), the message sent to the intended recipient, main administrator An Administrator is a VPOP3 user who is allowed to change VPOP3 settings, add/remove users, view queued messages etc. or redirect/copy target includes the name of the rule, so it can be helpful to make the name meaningful (or at least unique!). The rule name is also logged in the DLRULES.LOG file.
followed by
Zero or more Rule Condition lines (indicating what conditions need to be matched to trigger the rule).
Rules are processed in the order they appear in the Download Rules definitions, and processing stops as soon as a rule matches.
Download Rule activations are automatically logged to a file called DLRULES.LOG in the VPOP3 directory.
The following samples show some common uses of download rules, and how to achieve them