HOWTO Remove GMX Antispam Header from mails in kmail

I recently had enough of all the "*** GMX Antispam ***" lines in my kmail junk folder and tried to get rid off it. (It also marked false positivies in my incoming folder which also annoyed me).

Here's a small guide to strip the "*** GMX Antispam ***" string from your mail's subject (notice: this won't sort your mails in your junk folder, it only strips the subject line):

  • Fire up kontact/kmail
  • Go to Settings -> Configure Filters...
  • Add a new filter
  • Move it to the top of the list
  • Rename it to something like "Rewrite-GMX-Antispam-Header"
  • Now have a look at the general tab, add "X-GMX-Antispam" to the first field
  • Then choose "matches reg. exp." in the drop down box
  • Enter "^[2345]" in the following field (kmail will now match all mails which have been marked by the GMX Antispam service)
  • In "Filter actions" choose "Rewrite header" and choose "Subject" in the next field
  • In "Replace" enter "\*\*\* GMX Spamverdacht \*\*\*\ "
  • The last edit field must be blank.

If you don't know how to sort mails marked as GMX Antispam into your junk mail folder:

  • Add a new filter (Filter must be listed below the above filter rule)
  • Rename it to something like "GMX-Antispam"
  • Now have a look at the general tab, add "X-GMX-Antispam" to the first field
  • Then choose "matches reg. exp." in the drop down box
  • Enter "^[2345]" in the following field (kmail will now match all mails which have been marked by the GMX Antispam service)
  • In "Filter actions" choose "Move into folder" and select your junk folder in the next field.
  • If you like, you can also mark the mails as read immediately