[Imap-protocol] SEARCH restricted to one mailbox? Extensions?
tss at iki.fi
Mon Mar 12 16:54:33 PDT 2007
On Mon, 2007-03-12 at 16:29 -0700, Bill Janssen wrote:
> I basically want to be able to do searches across my entire mail
> database, instead of just folder-by-folder, and I'm wondering how to
> plaster that into the protocol. I suppose one way would be to present
> all the mail as one tricky folder which normally contains one message,
> but responds to SEARCH over it by suddenly filling itself with the
> results of the search, sending an untagged EXISTS, and sending them
> back to the client. The mailbox would gradually fill up with search
> results; I'd have to expire them and send EXPUNGES periodically.
That's a pretty nice idea, I think I'll do something similar if/when I
implement support for searching multiple mailboxes :) The way I'd do it
- Have one "Search all folders" mailbox
- It has zero messages initially
- SEARCH done inside it
1) EXPUNGEs all the existing messages if there are any (although
unless UID SEARCH is done, the EXPUNGEs can't be sent to client yet)
2) Adds all the matched messages virtually to the mailbox, and
returns EXISTS with the new message count (includes the old messages
with non-UID SEARCH)
3) Send SEARCH result after the EXISTS reply with listing all the new
Hmm. I guess this could be generalized to be a virtual folder where the
search rule gets updated by the SEARCH command.
There also exists a draft for searching multiple mailboxes:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: This is a digitally signed message part
Url : http://mailman1.u.washington.edu/pipermail/imap-protocol/attachments/20070313/ccc0cc5d/attachment.bin
More information about the Imap-protocol