Christian.net Sunday
September 7 2008

Help Documents: PEP

Main | Actions | Headers | Tests | Commands | Reply Files | DNS Blocklists | SpamAssassin | Challenges | Glossary | Spam FAQ | SMTP Tutorial | PEP Wizard

These web pages explain how to use PEP, our custom email filtering software. PEP is a very powerful tool with many features. We have tried to make the documentation as easy to comprehend as possible, but we understand that it's still a lot to read. If you have any questions about using PEP, contact our support folks or post a question in the helpdesk forums.

What is PEP?
PEP stands for Personal Email Processor, and it is a computer program that delivers e-mail messages to your mailbox. It can test each message against a set of rules that you define and take various actions like deleting the message, keeping it, forwarding it to another address, sending it a fax machine or pager, and much more.

What do I need to download?
Nothing. PEP runs on our mail server, you don't need to download anything at all.

What does it cost?
Nothing.

Can I use it on another ISP?
No, the software is proprietary.

How do I enable PEP?
You need to create or upload a file named "mailrule" and place it in the main directory of your account. This file will contain various rules and commands for PEP.

Ok, but how do I disable it?
Just delete your mailrule file. Note that PEP is still used to deliver mail to you, whether you have a mailrule file or not (and some tests, like virus scans, are performed anyway).

Where exactly does the "mailrule" file go?
In your main directory/folder. This is the location you will be in when you log in with FTP or with the File Manager. For example, if you log into your account with an FTP program you should see a list of files and folders similar to this (unless your account is completely empty of course):

drwx------  2 1614     50            512 Oct 24 13:50 mail
-rw-r--r--  1 1614     50             27 Dec 14 23:05 mailrule
drwxr-xr-x  3 1614     50           1024 Dec 28 21:52 temp
drwxrwxr-x  2 1614     50            512 Aug  8  2000 www

Most of that is irrelevant. The main thing to note is that you don't need to change into a sub-folder.

NOTE: The file name must be spelled "mailrule" and must be all lower-case or it won't be recognised. It must not have any extensions like ".txt" or ".doc" or anything else.

What goes in the mailrule file?
The mailrule file is a plain text file. If you create it with a word processor, make sure you save it as "plain text" or "ASCII".

Each line of the mailrule file represents a rule that will be applied to incoming messages. Rules must not wrap across multiple lines, and you can only have one rule per line.

Rules all have the same basic format: ACTION if HEADER TEST VALUE P1 P2

  • "ACTION" is an action like "KEEP", "DELETE", or "FORWARD" (there are many more actions available).

  • "HEADER" is a header like "FROM", "TO", or "SUBJECT" (you can specify any header you want, and there are several special headers as well).

  • "TEST" is a comparison test like "EQUALS", "CONTAINS", "MATCHES", etc. (there are several tests you can use).

  • "VALUE" is the value you want to compare the header to. If this value contains any spaces, it must be enclosed in quotes, otherwise quotes are optional.

  • "P1" and "P2" are optional parameters that certain actions might need. Like VALUE, they must be enclosed in quotes if they contain any spaces.

Here's a sample mailrule file :

keep if from contains bob@hotmail.com
fail if origin contains hotmail.com with "Spam not welcome here!"
delete if sascore > 7
forward if subject is "new order" to bob@hotmail.com

That example contains 4 rules, but it's easy to see that a complex mailrule file might get difficult to read. Here's the same mailrule file but with comments and blank lines to make it more readable (blank lines and lines that begin with a # are ignored by PEP):

# Keep any mail that comes from my business partner Bob
keep if from contains bob@hotmail.com

# Bounce any other mail that comes from HotMail
fail if origin contains hotmail.com with "Spam not welcome here!"

# Quietly delete any mail that has a high spam score
delete if sascore > 7

# And finally, if this is a message from my shopping cart,
# forward it to Bob for processing
forward if subject is "new order" to bob@hotmail.com

How big can my mailrule file be?
In theory it can be any length you want, there is no limit to the number of rules it can contain. However, if your mailrule file is quite long (say 100 or more rules) then there's probably a more efficient way to write it.

Does the order of the rules matter?
Yes. Generally speaking, the first rule that matches the message is the one that is used and all subsequent rules are ignored.

In the example above, we used a KEEP rule to keep mail from bob@hotmail.com and that was followed by a FAIL rule for all hotmail addresses. These work as expected because of the order. If we were to move the KEEP rule down below the FAIL rule, we'd never see any mail from Bob because the FAIL rule came first.

Is there an easier way to maintain my mailrule file?
Yes, you can use the webmail system's PEP Wizard to do basic filtering.