Although spam and virii do not directly impact the security of an email server, many email servers offer spam and virii filtering for recipients. There are standalone programs to filter spam and virii. For example, SpamAssassin (http://spamassassin.apache.org/) is a frequently used spm filter program. ClamAV (http://www.clamav.org/) is an antivirus filter.
However, fitting the filters into an email server can be quite tricky. It is impractical to write filter code in an SMTP server. At the same time, it is also impractical to support SMTP in the filters. Somehow the SMTP server needs to be able to use the filters to determine whether a message is spam or contains virii, then determine what to do with it. Fortunately, most SMTP servers have a hook to do so.
AMaViS (A MAil VIrus Scanner, http://www.amavis.org) is the glue of all the components. When an SMTP server (such as Postfix) receives a message, the message is sent to amavis. Amavis, in return, invokes SpamAssassin and ClamAV to evaluate the message. Based on the return statu of amavis, postfix determines whether the message should be marked, quaranteened or simply deleted.