Joined: 07 Jun 2006 Posts: 86 Location: Berlin, Germany
Posted: Fri 23 Feb 2007, 18:16 Post subject:
How to remove attachments from kmail
...yust set up a filter with the action 'pipe through' and the command:
egrep -v ^.[A-Za-z0-9=/+]{68}.*$
Thats it. Be shure to set the filter to 'manual' as this deletes data.
Have fun!
fudgy
ps.
please tell me if i forgot to include characters in the RegEx. This RegEx simply looks for strings with no spaces for a length of 68 characters minimum in one line. If these are found, they are excluded (-v option). The output is passed back to kmail - replacing the original message.
pps. The attachment will be 'visible' to kmail (with 2 bits length) so you know the name it had. You can use the %1, %2 etc. command to save attachments before deleting, like so (filter action 'execute command'):
cp %1 /initrd/mnt/dev_save/attach/`date --iso-8601 +%F-%H%S`-001
...but unfortunately one loses the name of the original attachment. So I prefer saving by hand before stripping it off my email folder.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum