Bug 169796 - possibility to use kcron on some folders rather than the present possiblities
Summary: possibility to use kcron on some folders rather than the present possiblities
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.10.0
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-25 17:17 UTC by dmoyne
Modified: 2012-08-19 00:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dmoyne 2008-08-25 17:17:51 UTC
Version:           1.10.0 (using 4.1.00 (KDE 4.1.0), Kubuntu packages)
Compiler:          gcc
OS:                Linux (x86_64) release 2.6.24-19-generic

Is it possible to have an interface with Kcron to handle content of some folders expiration :

I have a case where I have 2 folders a "Spam" and "NonSpam" folders to train bogofilters from time to time ; consequently I want the following action to be done :
#!/bin/sh
dir_data=/media/USER1_data/dmoyne_data/Mail_data/KDE_Mail/.Bogofilter.directory
kmail=/usr/lib/kde4/bin/kmail
#a) we train bogofilter on Spam and NonSpam folders
echo "training on Spam mail"
bogofilter -sv -B $dir_data/Spam/cur
echo "training on non-Spam mail"
bogofilter -nv -B $dir_data/NonSpam/cur
#b) we clean Spam and NonSpam folders only if KMail is not running
if [ "$(pidof $kmail)" ]
then
  echo "KMail is running : we do not delete files as this might be troublesome";
else
  echo "KMail is not running : we delete content of Spam and NonSpam folders";
  find $dir_data/NonSpam/cur -iname \*.* -exec rm {} \;
  find $dir_data/Spam/cur -iname \*.* -exec rm {} \;
fi
#c) we display some information on bogofilter data base
echo "message count :"
#bogoutil -w ~/.bogofilter .MSG_COUNT
echo "wordlist.db :"
#bogoutil -d ~/.bogofilter/wordlist.db
echo "finished"

The problem with this action is to make proper cleaning of files (this is the reason I do not do the job when Kmail is running) ; even when KMail is off such drastic cleaning may be problematic ; consequently if an interface between KMail and Kcron could be managed my script could be run in a coherent manner whatever the status of KMail : running or not.

Can something be done ; until such development be integrated rather than use an rm command can I use a special Kmail command to do the same whatever the status of KMail : running or not.

Regards.
Comment 1 Björn Ruberg 2010-01-28 23:40:27 UTC
I don't understand what you exactly want. And I exspecially don't understand what you need what you cannot do with folder expiration and/or filters using an external script
Comment 2 dmoyne 2010-01-30 17:55:29 UTC
Ok I will investigate use of an external script sytematically run by a filter.
Comment 3 dmoyne 2010-02-08 16:12:03 UTC
I want to process all messages located in "spam" and "nonspam" folders of KMail with a script ; such script after update of the bogofilter data base, remove all the processed message from the "spam" and "non spam" folders.

If I use a filter I have the possibility to use the same one as the one called "bogofilter_is_spam" and add after the transfert in "spam" folder the execution of my script but this action has some drawback : it is done systematically without my visual checking of the content of the "spam" folder to possibly transfer manually some messages mishandled in the "non spam" folder, and furthermore it does not process the content of the "non spam" folder.

The best would be addition of some other conditions than an expiration date on folder for example each other period of time execution of a script, but this would not solve the problem created by the execution of the script based on bogofilter that after processing of the messages remove them from both the "spam" and "non spam" folders, and therefore interfere with KMail running.

So if I come back to the logical idea of using kcron to execute my script each other period of time, what in case of Kmail being open when removing messages from both the "spam" and "non spam" folders, in other words are there any possibilities to communicate with KMail to call for deletion of all messages contained in the"spam" and "non spam" folders, in a very coherent manner.
Thanks.
Comment 4 Myriam Schweingruber 2012-08-18 08:56:57 UTC
Thank you for your feature request. Kmail1 is currently unmaintained so we are closing all wishes. Please feel free to reopen a feature request for Kmail2 if it has not already been implemented.
Thank you for your understanding.
Comment 5 Luigi Toscano 2012-08-19 00:19:22 UTC
Instead of creating a new feature request, please confirm here if the wishlist is still valid for kmail2.