Kmail Sanitize and Decrypt Mails

From Trinity Desktop Project Wiki
Jump to: navigation, search

This is an example how to create a filter in kmail that removes unwanted headers and automaticly decrypts incomming mails. The decrypt feature was a long standing item on my wishlist: I only need encrypted mails for transport, but not not on my disk.

Now here is how to do that:

  1. save this file File:Kmail-decrypt-and-sanitise-mail.gz in your ~/bin folder or any place else suitable for you, unkopress the file and make it executeable.
  2. chmod a+x /where/you/saved/the/file/kmail-decrypt-and-sanitise-mail
  3. Open kmail, go to "Settings/Configure Filters ..."
  4. Create a new filter, name it as you like and move it to the top of the list
  5. On the tab "General" leave "Filter Criteria" empty.
  6. set "Filter Actions" to "Pipe Through" and set the program path to /where/you/saved/the/file/kmail-decrypt-and-sanitise-mail.
  7. On the tab "Advanced" uncheck "If this filter matches, stop processing here"

Now all incomming mails get decrypted by default (if a key is present), and some tags are removed (X-UI-Filterresults:, X-GMX-Antivirus:, ... you find them in line 45)

You can of course use the program to change other aspects of mails, you could trigger automatic actions ... whatever you like :)


Enjoy.