Filtering Mail

One of PocoMail's most dynamic features is its filtering capability. The following is a brief overview of filtering for those users who are unfamiliar with this function.

What is filtering and why do I need it?

Filtering is a process by which e-mail messages are run through a set of conditions set by you. If e-mails meet those conditions, then they are acted upon by actions that you define. Simple filters can be built with the least number of conditions and actions; while more complex filters can have several conditions and actions. The whole process is designed to assist you in managing mail without having to manually move, copy or delete a large number of mail messages.

Conditions and Actions

One of the simplest "built-in" filters that you may have already set up in PocoMail can be found in the Accounts Setup, in the Optional screen. In the partial screenshot below, you set an action in a filter by telling PocoMail to put incoming mail into the "In" mailbox, and all outgoing mail into the "Sent" mailbox. The conditions are incoming and outgoing mail for "My Account".

Another way to look at filters and conditions are to regard them as "if - then" relationships. Translated this way, the same filter would be "If mail is received for My Account, place it in the In mailbox." The second part would be "If mail is sent for My Account, place it [retained copy] in the Sent mailbox."

Drag and Drop Filtering

In Program Options - Drag and Drop Settings, PocoMail lets you auto-create filters simply by dragging and dropping a contact from your address book onto a mailbox. The condition is "if mail is received from that specific contact".

The next options are the conditions, "then copy the mail to new mailbox"; or "then move the mail to new mailbox".

You then set the filter to run either on all incoming mail, all outgoing mail, or both.

This process makes it very easy for you to add filters to PocoMail. To further modify these filters, access them from the PocoMail Menu - Tools, Filters (Quick Key F4), highlight the filter to be changed and click on Edit. The filter dialog box will popup and you can make your changes to the conditions and actions.

While it is very easy to create an unlimited number of filters, note that PocoMail will execute the filters in the order in which they appear in the Filters screens. You need to be careful of filter order in the event you need to have more than one filter process the same e-mail messages. If you inadvertently set one filter to stop processing mail and place it in order before (or above) another filter that needs to mark that same e-mail (same conditions), it won't happen. Filers can be rearranged by dragging them up or down the list and dropping them in their new places.

Quick Filters

You can also make "quick filters" from both the Index Pane and the Preview and Message Panes.

In the Index Pane, highlight a message for which you want to make a quick filter. Right click to access the drop down menu and select Quick Filter for. A new filter entry will be launched for you to complete. The nicest feature of making a quick filter from the index is that the newly created filter can be customized by the column you right-click in. For example, if you want to create a filter on the subject line, right click from the Subject column and that will be the first condition of the filter.

In the Preview and Message Panes, you can only launch the new filter entry from the address fields - either the From or To: headers. Right click on either of these to create a filter.

Multiple Conditions and Actions

To build a new filter, access the Filter screen from the PocoMail Menu - Tools, Filters (Quick Key F4).

Click on New Filter. Don't be fooled by the small screen that appears. PocoMail allows you to set up to six conditions and six actions per filter and as you add conditions or filters, the screen will expand. Refer to the image below.

For every field or text box in the filter screen, PocoMail accesses a drop down menu with preset options or presents fields for you to fill in with specific information.

Examples of condition information in a filter:

Filter messages for - Drop down menu for all accounts
Search - A drop down menu with header "tags" found in e-mail messages, such as "To," "From" "cc:", "Subject", "Content-Type".
for - Specific text must be provided to be searched for
Match only if not found - allows you to "reverse" the condition to be a "negative" or exclusionary condition
Case sensitive match - only if the condition must match character case as typed in the "for" field and - This is one of the logical modifiers in the drop down list, which includes: then, and, or, unless. The then modifier will necessarily lead to the Actions.

Examples of action information in a filter:

Perform - Drop down menu for actions, such as "copy message to", "move message to", "Mark message as", "dialog box with text", "run application". When there is a range of "preset" options, such as for the "copy message to", the list of mailboxes you have created would be accessed. When there is a specific non-PocoMail function requested, like "run application," you will need to provide the specific path and application information so that PocoMail can redirect and execute the application. And - use to link further actions.

Using Stop Processing as an action effectively stops any further actions being executed on that particular message, including any further filters following this filter. Using Move Message or Delete Message will have the same effect on the filter queue. If you do not want to stop the message processing but still want to save it to another mailbox you can use Copy Message action instead.

With so many options available in both conditions and actions, PocoMail's filtering feature is obviously a very powerful tool. The best way to learn about filtering is to build, test and apply to see what works best for your e-mail management needs.

Incoming, Outgoing, Pre-Download and Post-Send Filters

PocoMail offers different "flavors" of filters.

Incoming - These filters act on incoming mail.
Outgoing - These filters act on outgoing mail in such a way that any changes you make to the message per the outgoing filter will be received by the recipient
Post-Send - These filters act on outgoing mail after they are sent. Any changes you make to the message per the post-send filter will only be saved to your specified mailbox.
Pre-Download - These filters act only on message headers, and not message bodies, before they are downloaded. Actions are limited with this "server side filtering" and the only recommended actions are delete, download and leave on server. Other aspects of "server side filtering" are discussed in Dealing with Junk Mail.

Adding, Editing and Deleting Filters

To add a new filter "from scratch", access the Filters screens, select the appropriate tab (e.g., Incoming), and click on New Filter.
To edit an existing filter, highlight the filter and select Edit.
To delete a filter, highlight the filter and select Delete.

Add Script is used to set up a PocoScript to be run on an account, and does not have any ability to affect any existing filters. Scripting will be discussed in Filters and Scripts: The Dynamic Duo and Setting Up Scripts.

Sorting Filters

You can sort filters by toggling the headers, just as you would in the Index Pane. Be aware, however, that since PocoMail runs filters in the order in which they appear in these screens, sorting will necessarily rearrange the filter processing order.

Selected Filtering

PocoMail also gives you the ability to selectively run filters. These filters may be different from those you have set to run automatically in the Incoming, Outgoing, Pre-Download and Post-Send Filters.

These manual filters should be set up in the screens tabbed with the mailbox icons. The four different screens are only "containers" for the filters, and are provided to help you organize manual filters.

Run filters on selected messages by following these steps:

Alternatively, to run only selected filters on selected messages, access the Filter Screens directly, highlight the appropriate filter and click on Run on Selected.

Dealing with Junk Mail

If you have been using e-mail for a while, you have probably encountered more than your fair share of junk mail. While you could use other PocoMail features - Pre-download filtering or manually deleting such mail using View on Server - PocoMail's Junk Mail Filtering function is better suited to managing this bane of e-mail users.

There are some basic filters already built into Junk Mail Filtering. For instance, PocoMail can discriminate between your "regular" mail from known correspondents and "real" junk mail by filtering against your address books. Also, messages are examined for aspects that are common to a lot of junk mail.

You can further enhance PocoMail's "discrimination quotient" by adding to its Word Lists in Junk Mail Filtering setup (discussed below).

To access this setup from PocoMail Menu, select Tools, Junk Mail Filtering (Quick Keys Ctrl+F7).

Note that PocoMail's standard operating procedure is to download detected junk mail into a "Junk Mail" mailbox (auto-created by PocoMail), and to delete the mail from the server.

Click on General Settings tab to see the next screen. Options are to run automatic junk mail filters:

In both processes, the mail will be deleted from the server. A note of caution: if you run filters before downloading messages, and you find after looking at the headers that a message wasn't junk mail, you will need to have the sender resend the message to you. That contact should be added to your address book or the Word Lists to avoid future inadvertent junking of "good" mail. Also, filtering before message download will be less accurate than post-download junk mail filtering. If you are after accuracy rather than speed, it is recommended to use post-download filtering.

Custom Sensitivity - This slider corresponds to the selected sensitivity level at the top of the screen. You can modify the setting by sliding the pointer.

Junk Mailbox - PocoMail auto-creates the Junk Mail box. You may, however, create your own mailbox and set it as the destination junk mailbox. (If Junk Mail box does not appear in the Mailbox pane after the first time you use Junk Mail filtering, you may need to refresh your mailbox pane. Go to PocoMail Menu - Mailbox, Refresh List of Mailboxes.)

The last screen for Junk Mail Filter settings is Word Lists.

You can manually add information to these Word Lists. PocoMail will use these lists to match against and filter junk mail.

Click OK to accept these settings.

If you are still unsure about your junk mail or want to tweak the Junk Mail Filters in a more visual manner use the View Mail on Server feature to check your filters. When you connect to the server you may notice exclamation marks displayed on certain messages, these are PocoMail's junk mail indicators discussed above. The number of exclamation marks indicates how likely PocoMail is to treat this message as junk mail:

!!! Very likely junk mail, message will be treated as junk mail even if PocoMail is set to Low Sensitivity junk mail filters.
!!  Possible junk mail, message will be treated as junk mail at Medium Sensitivity.
!   Potential junk mail, message will be treated as junk mail at High Sensitivity.

By using the Junk Mail Filtering options you can tweak PocoMail's junk mail detection to ensure that no friendly messages end up in the Junk Mail mailbox. View Mail on Server is a good indicator of how well your Junk Mail Filters are setup, and how they will work on the messages currently on the mail server next time you Check Mail.

Is there another way to add entries to the Word Lists rather than going through all the screens?

You can add entries to the Word Lists directly from the Index Pane or PocoMail's Menu.

From the Index Pane - Highlight the message you want to use and right-click for drop down menu, select Junk Mail Filtering for Word List options.
From the PocoMail Menu - Select Message, Junk Mail Filtering for Word List options.

Filters and Scripts: The Dynamic Duo

PocoMail's standard filtering capabilities are quite powerful, and with all the permutations possible with filtering coupled with other features, such as Templates, you may find your e-mail management needs fully satisfied.

However, if you need to have further customization that is not possible through the standard array of features, then you may want to explore PocoScript. Although scripts can be considered a filter in as much as conditions and actions are built and processed, scripting allows you to reach beyond the set conditions and filters to produce complex actions and processes. The dynamic alliance of filters and scripts can exponentially increase PocoMail's capabilities in both filtering messages and performing very sophisticated actions upon messages.

What is PocoScript?

The short and sweet answer to this question is that PocoScript is an interpreted language created for PocoMail that focuses mainly on mail processing and handling. However, PocoScript has broader capabilities than e-mail handling, and can be used as a conduit between PocoMail and external applications, such as mail encryption (e.g., PGP encryption) or FTP processing.

Like any language, PocoScript has its own syntax and vocabulary, which you must learn in order to write more complex PocoScripts. However, you don't need to learn to write PocoScript files in order to take advantage of scripting. PocoMail provides several PocoScripts (.poc file extension). You can see the list of scripts from PocoMail Menu - Tools, All Scripts Run.

If you purchased PocoMail you will have access to additional scripts through PocoMail's website (pocomail.com).

You don't need an intimate knowledge of PocoScript in order to create simple scripts. A short lesson on how to write such a script follows a bit later.

The script buttons are located on the far right of the PocoMail Toolbar, marked "1 2 3". If you have Tool Tips enabled, holding your cursor over one of these buttons will show you what script is configured to use this button. PocoMail allows you to configure up to 10 scripts on the toolbar buttons. Scripts configured for buttons also can be run from the PocoMail Menu - Tools, Scripts Run (Quick Key F9). Another option - Tools, All Scripts Run - accesses the drop down menu of all PocoScripts available in the Scripts directory.

If you would like more in-depth information about PocoScript, refer to PocoScript Help.

Setting Up Scripts

Setting up scripts can be as easy as pointing and clicking in the Scripts screen, while some may require a bit more input from you, depending on the actions that are to be processed.

The following example of setting up a script will use the "Vacation Message" script that comes with PocoMail.

Access the Scripts window from the PocoMail Menu - Tools, Scripts (Quick Key F9).

Click on Close.

Now when you look at your PocoMail Toolbar, the number "4" should appear in the Script Buttons area. To test your script set up, highlight a message in the index pane and click on the script button. A message should appear in the Out Mailbox with the vacation message text appended to the specified message.

Of course, this is just an exercise to get you acquainted with scripts. If you were really on vacation, you wouldn't be running this particular script manually!

However, let's continue this exercise by taking the script one step farther.

Suppose you work in an office that uses PocoMail, so the network is always on. You are going for those tapas in Seville and need to have this Vacation Message run on all your incoming mail so no one thinks you've been made redundant. How to do this? Why, by teaming up the script with a filter!

In the earlier description of the filters screens, a filter screen named Add Script was mentioned, but not discussed. This is where the script and filter become a dynamic duo.

Once this script is active you will need to enable Send queued messages when checking mail, enable Check for new mail at specified intervals and leave PocoMail running while you are away, Vacation Message script will do the rest. This simple example gives you an idea of how filters and scripts complement each other. If you have more complex e-mail needs that can't be satisfied by the regular filters, PocoScripts and filters may be what you need.

The next exercise is how you can create a script that will allow PocoMail to launch an external application from one of the script buttons on the Toolbar.

What you are looking at in the first three lines is just a description of what the script is supposed to do. Remarks like these are prefaced by { so they will be ignored by PocoScript when processing.

The next line "Execute calc.exe", is just pointing to the executable file for Windows Calculator. If this script were set up on button 5 on the Toolbar, clicking on it would bring up the Calculator.

Once saved, this script becomes available in the list of scripts.

Note: Using the Debug tab button after doing a Debug Run will show you all the variables and their values returned as executed in the script. This is a great way to familiarize yourself with PocoScript.

Not only can you set a button on the Toolbar for your new WordPad script, you can make it a filter as you did with the Vacation Message, or even make it one of the actions in a multi-action filter.