I have a IMAP resource with offline support. KMail uses clamav with the help of the kmail_clamav.sh script to scan the mails on the server by downloading them, adding a virus flag and put them back to the server. Unfortunately this script is buggy and it will double the size of the mail each time it is scanned. One mail that I have in the box since ~3 weeks has meanwhile a size of 540MB causing KMail to crash after allocating more than 4GB of memory and bringing the complete system nearly to halt because of major IO/swapping activity.
Steps to Reproduce:
1. Ensure that you have clamav installed and running
2. Create a resource for an IMAP account with offline support
3. Ensure that you have a mail with a bigger attachment in your inbox
4. Trigger the scan
5. Repeat last step
Memory usage is constantly growing, mail on server doubles with each scan.
Actually I do not expect KMail to rescan a mail that has already a X-Virus-Flag, nor do I expect the mail to double.
How can I clean up this mess now on my server?
Sorry, means kmail-4.7.4-r1 in subject
The problem arises with any AV integration filters currently and its not the scripts, it has to be a changed behavior of KMail itself. See upstream bug description.
Does this issue persist with a more recent version of kmail?