KMail uses two special filters to provide a modular access to spam-filtering programs:
These modular filters can be combined with text filters to detect (for example) e-mail which has been flagged by SpamAssassin by looking for the special headers it added.
KMail allows manual filtering of spam directly on the mail server, a very interesting feature for dial-up users. Emails that exceed some threshold size (standard is 50 kb, but it may be set any value) are not automatically copied to the local computer. With "get, decide later, delete" options, KMail lists them but does not download the whole message, which allows the deletion of spam and over-sized messages without wasting time.
KMail supports the OpenPGP standard and can automatically encrypt, decrypt, sign, and verify signatures of email messages and its attachments via either the inline or OpenPGP/MIME method of signing/encryption. KMail depends on GnuPG for this functionality. As a visual aid, KMail will colour verified email messages green for trusted signatures; yellow for untrusted signatures; red for invalid signatures; and blue for encrypted messages.