Re: Filter Question

Le 14.11.2005 13:29:55, Håkan Hagenrud a écrit :
I don't know if it can be done, I would like to set up a filter that removes mails in a mailbox that is older than two weeks. I'm thinking of using something like "today" as first date and "today+2weeks" in last date and let the filter remove mails that are older than that.

Can it be done?
I have searched the net with no luck. Thanks for your time.

Replying to the list this time...
It cannot be done now (at least not really conveniently). I am coding a patch to do that and more. Here is the idea so people can comment on its usefullness/praticality. I will allow the user to enter a "partial date" in the date fields for a date filter; that is you can ask balsa to filter between the following to dates for example (let's say this is in the US locale: mm/dd/yyyy): */01/* to */31/*: meaning filtering everything of the current month (stars are replaced by the corresponding fields (here month and year) of today's date.
You will also be able to use "offsets":
-1/01/* to */31/*: meaning last month plus the current one;
or also:
*/-28/* to */*/*: meaning the last 4 weeks
And any combination you can think of...
Advantages: completely backward compatible with the current filters as you just have dates strings.

Codewise nothing is changed for the API of the filters; you still have only to check the date interval (which is still given by 2 time_t's). This is achieved by computing the "partial" dates right before filtering (in the prepare_filter fonction). The only problematic (but already coded) part is about the locale legwork: from the canonical representation we use to store everything (yyyy-mm-dd) to the locale's one. Basically alsmot everything works (I still have to worry about a few things for the computing of the dates but should be OK soon).

Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]