On Wednesday, Aug 20, 2003, at 19:30 Europe/Helsinki, Mark E. Mallett wrote:
It's also where I was going to put the Sieve scripting. I was going to create a separate "deliver" binary which would read the mail from stdin and place it into proper mailbox. This could be also used to update indexes immediately while mail is being delivered.
How important do you think it is for the local delivery agent to update the indexes upon delivery? I assume that would be the primary purpose of your including a delivery agent in the package..
No, the primary purpose would be to have Sieve scripting.
The index updating then .. well, there's two reasons why it's useful at that point:
First it reduces the overall server load. We have to read the mail into memory and write it to disk in any case, so we might as well parse it's contents and update indexes. If we do it later, we might have to fully read the mail from disk just for some client request. Although I don't know how smart the SMTP servers are with maildir - do they just link() their temporary file into the new/ dir rather than copy it?
Second it distributes the load. If user hasn't opened some mailbox for a long time (eg. spambox) and it contains thousands of messages, the opening could take quite a long time if the wanted data isn't indexed.
If it's important to update the indexes upon delivery, perhaps it would be worthwhile to provide some kind of toolkit that could be included into other delivery agents. I'm already using a sieve-ish filtering delivery agent, and I imagine I would keep on using it. But I wouldn't be averse to adding logic to update indexes if it meant some kind of performance gain.
There already is, kind of. lib-storage/mail-storage.h is the main API that can be used to access mailboxes.