Spam filtering basics

CSLab has a server-side spam recognition system that tags email based on what it thinks of its characteristics (how this is implemented sometimes changes, so will not be discussed further here). The biggest obvious advantage to the user is that you yourself do not have to perform any training or setting up of spam filtering -- we do it for you.

Email that is classified as being either "spam" or "virus" have the following respective tags prepended to the Subject line:

[PMX:SPAM] if the email was classified as spam.


[PMX:VIRUS] if the email was thought to contain a virus (the virus itself is also stripped away).

Basic filtering with .forward-nonspam

If you just want to discard all of the messages to you that are scored as spam or viruses, all you need to do is create a .forward-nonspam file that contains: your_login_name

(Change your_login_name to whatever your Unix login is.)

For more information on how this works, see our page about email filtering.

If you also want to save a copy of the spam and virus tagged messages, also create a .forward file that contains something like:


(Then make sure that the /u/your_login_name/mail/ directory exists.)

Advanced Setup with procmail

Since we tag all email before it's processed locally, all you need to do is set up procmail filtering to filter away email based on the Subject line. There are two files that you need to create and/or modify in order to make this work, the .forward and .procmailrc files in your home directory. The former is needed in order to pass messages onto procmail instead of delivering them directly to your mail folders; the latter contains the actual filtering rules.

Below are simple, working examples of the .forward and .procmailrc files that you can use as templates. {i} Please note that in all of the examples, you need to replace username with your CSLab account name.

For more detailed information on setting up a custom procmail configuration file, please go back to the spam filtering page and click on the "More detailed procmail information" link, also available through here.

Template for ~/.procmailrc

# Set default for normal mail placement.


# Set this to the directory where you want to keep all the
# mail folders used by procmail (it is typically the same
# directory as your mail reader keeps its folders).


# Set this to the name of the file in which to log procmail's actions.



# Filters for CSLab spam and virus tags.


* ^Subject:[    ]*\[PMX:SPAM]



* ^Subject:[    ]*\[PMX:VIRUS]


# By this point, anything that has not been delivered will go to $DEFAULT.

Template for ~/.forward

"|IFS=' ';exec $MAILBIN/bin/procmail -f-"

A caution about peeking under the hood

CSLab's current spam recognition puts more detailed information about its opinion on the message into several headers, all of which have names that start with X-CS-. You can see the current state of these headers by inspecting the headers of your email. However, these headers are primarily for diagnosis and information, and CSLab may change them from time to time without specific notification. The [PMX:SPAM] tag in the Subject line is the only guaranteed permanent sign of what the mail system considers to be spam.