Kmail Sanitize and Decrypt Mails
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:
- 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.
- chmod a+x /where/you/saved/the/file/kmail-decrypt-and-sanitise-mail
- Open kmail, go to "Settings/Configure Filters ..."
- Create a new filter, name it as you like and move it to the top of the list
- On the tab "General" leave "Filter Criteria" empty.
- set "Filter Actions" to "Pipe Through" and set the program path to /where/you/saved/the/file/kmail-decrypt-and-sanitise-mail.
- 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 :)