[Dovecot] extended search
Hello,
is it safe to use arg_new_human_date() from src/lib-storage/mail-search-register-human.c instead of arg_new_date() inside src/lib-storage/mail-search-register-imap.c?
The benefit is ability to use interval based search rules, e.g., SINCE 2days. I run it for couple of days and looks fine, used for virtual folders.
This kind of search I missed for usage on laptop - I have pretty huge inboxes, thunderbird was over 20% CPU all the time. I switched on using dovecot locally and thunderbird connected to it, my common searches (before: thunderbird's "save as folder" searches) are virtual folders. Everything works great, cpu usage is less than 1% (I have to say that I also moved many filtering rules (for sorting incoming messages to folders) from TB to be done by imapfilter, but the reason was mainly sorting flexibility and rescanning folders).
If all is safe, would it be considered for addition in the future version? The patch is trivial, I can leave with patching every release, but I believe is a nice thing to have. Afaik, should not break IMAP SEARCH specs, being an extended version. An alternative would be to add 'X-' commands (e.g., X-SINCE 2days).
Thanks, Daniel
-- Daniel-Constantin Mierla http://www.asipto.com
On Mon, 2010-09-06 at 18:42 +0200, Daniel-Constantin Mierla wrote:
is it safe to use arg_new_human_date() from src/lib-storage/mail-search-register-human.c instead of arg_new_date() inside src/lib-storage/mail-search-register-imap.c?
I guess.
The benefit is ability to use interval based search rules, e.g., SINCE 2days. I run it for couple of days and looks fine, used for virtual folders.
It's still possible, although less human friendly: "younger 172800" (i.e. younger than 172800 seconds).
On 9/6/10 7:06 PM, Timo Sirainen wrote:
On Mon, 2010-09-06 at 18:42 +0200, Daniel-Constantin Mierla wrote:
is it safe to use arg_new_human_date() from src/lib-storage/mail-search-register-human.c instead of arg_new_date() inside src/lib-storage/mail-search-register-imap.c? I guess.
The benefit is ability to use interval based search rules, e.g., SINCE 2days. I run it for couple of days and looks fine, used for virtual folders. It's still possible, although less human friendly: "younger 172800" (i.e. younger than 172800 seconds). I tried that, but for some reason it didn't returned proper results (might have been related to importing the emails to dovecot). Besides more human friendly, "since" worked fine. Also, younger is for internal date only, does not work for email's Date header (sentbefore/sentsince...)
-- Daniel-Constantin Mierla http://www.asipto.com
On Mon, 2010-09-06 at 19:13 +0200, Daniel-Constantin Mierla wrote:
is it safe to use arg_new_human_date() from src/lib-storage/mail-search-register-human.c instead of arg_new_date() inside src/lib-storage/mail-search-register-imap.c? I guess.
The benefit is ability to use interval based search rules, e.g., SINCE 2days. I run it for couple of days and looks fine, used for virtual folders. It's still possible, although less human friendly: "younger 172800" (i.e. younger than 172800 seconds). I tried that, but for some reason it didn't returned proper results (might have been related to importing the emails to dovecot). Besides more human friendly, "since" worked fine. Also, younger is for internal date only, does not work for email's Date header (sentbefore/sentsince...)
Well, the other thing I had been thinking previously was that maybe the dovecot-virtual files should use human parser for everything. I don't anyway really like the idea of exposing the "2days" extension to regular IMAP clients. Maybe some day there really is such an extension that is also incompatible with what Dovecot does..
Maybe there could be some command at the beginning of dovecot-virtual file specifying if human parser or imap parser should be used. Or maybe just a plugin setting. Hmm.
On 9/6/10 7:22 PM, Timo Sirainen wrote:
On Mon, 2010-09-06 at 19:13 +0200, Daniel-Constantin Mierla wrote:
is it safe to use arg_new_human_date() from src/lib-storage/mail-search-register-human.c instead of arg_new_date() inside src/lib-storage/mail-search-register-imap.c? I guess.
The benefit is ability to use interval based search rules, e.g., SINCE 2days. I run it for couple of days and looks fine, used for virtual folders. It's still possible, although less human friendly: "younger 172800" (i.e. younger than 172800 seconds). I tried that, but for some reason it didn't returned proper results (might have been related to importing the emails to dovecot). Besides more human friendly, "since" worked fine. Also, younger is for internal date only, does not work for email's Date header (sentbefore/sentsince...) Well, the other thing I had been thinking previously was that maybe the dovecot-virtual files should use human parser for everything. I don't anyway really like the idea of exposing the "2days" extension to regular IMAP clients. Maybe some day there really is such an extension that is also incompatible with what Dovecot does..
Maybe there could be some command at the beginning of dovecot-virtual file specifying if human parser or imap parser should be used. Or maybe just a plugin setting. Hmm. using human parser for virtual folders is indeed a good idea.
-- Daniel-Constantin Mierla http://www.asipto.com
participants (2)
-
Daniel-Constantin Mierla
-
Timo Sirainen