There are many anti-spam tools available. Some are available for free, and others are commercial products. Most anti-spam tools use more than one of the anti-spam techniques. SpamAssassin is the acknowledged leader of the free anti-spam tools and can perform as well as the commercial solutions.
SpamAssassin is a popular anti-spam tool that is now a top level project at the Apache Software Foundation.
SpamAssassin is based on rules and uses a score-based system. There are a number of rules; each rule performs a test on the email, and each rule has a score. When an email is processed by SpamAssassin, it is tested against each rule. For each rule found to be 'true' for an email, the score associated with the rule is added to the overall score for that email. Once all the rules have been used, the total score for the email is compared to a threshold value. If the score exceeds the threshold, then the email is marked as spam.
SpamAssassin does...