Hi,
I´m using a multi-storage architecture in my email environment and maildrop as deliver command at mta. But to this deliver the mx servers mount nfs partitions - we need to use maildrop because many patches we inserted.
How can I insert a piece of code at maildrop allowing it to update the dovecot indexes (which lib and/or function from dovecot I need to use ?)
Best Regards, Fernando
On Wed, 2009-09-02 at 18:23 -0300, fernando@dfcom.com.br wrote:
How can I insert a piece of code at maildrop allowing it to update the dovecot indexes (which lib and/or function from dovecot I need to use ?)
You can't really just update indexes, at least not without a lot of code. What you could do is ask Dovecot to save the message via lib-storage API. But that's not much different from just having maildrop execute Dovecot deliver instead of saving the message to Maildir. I'd guess your patches don't touch the actual Maildir delivery?
Very interesting...I don´t like the idea maildrop calling dovecot deliver (as an external program).
But I like the idea maildrop calling the dovecot api to save the message into the maildir.
And yes, my patches don´t touch the maildir delivery. So, I can just change the maildrop 'deliver' function and call the dovecot one.
Do you have any tip how to do that, I mean, witch function to use there ? How about quota, can I let maildrop or dovecot (through the api) update it (I believe that let maildrop do that makes more sense)?
Thanks, Fernando
On Wed, 2009-09-02 at 18:23 -0300, fernando@dfcom.com.br wrote:
How can I insert a piece of code at maildrop allowing it to update the dovecot indexes (which lib and/or function from dovecot I need to use ?)
You can't really just update indexes, at least not without a lot of code. What you could do is ask Dovecot to save the message via lib-storage API. But that's not much different from just having maildrop execute Dovecot deliver instead of saving the message to Maildir. I'd guess your patches don't touch the actual Maildir delivery?
On Wed, 2009-09-02 at 19:12 -0300, fernando@dfcom.com.br wrote:
But I like the idea maildrop calling the dovecot api to save the message into the maildir.
And yes, my patches don´t touch the maildir delivery. So, I can just change the maildrop 'deliver' function and call the dovecot one.
Do you have any tip how to do that, I mean, witch function to use there ?
I suppose you'd have to copy&paste quite a lot of code from deliver.c to read configuration. Dovecot v2.0 makes this a lot easier.
How about quota, can I let maildrop or dovecot (through the api) update it (I believe that let maildrop do that makes more sense)?
If you load quota plugin, Dovecot does it.
Can I just "replace" the function called to save the message in the maildir (and update the indexes) by the dovecot one? Do I need to copy the code to load configuration when using only the api functions ?
P.s: how about v2.0 - what is the stage? Is there any date to be released ?
Thanks, Fernando
On Wed, 2009-09-02 at 19:12 -0300, fernando@dfcom.com.br wrote:
But I like the idea maildrop calling the dovecot api to save the message into the maildir.
And yes, my patches don´t touch the maildir delivery. So, I can just change the maildrop 'deliver' function and call the dovecot one.
Do you have any tip how to do that, I mean, witch function to use there ?
I suppose you'd have to copy&paste quite a lot of code from deliver.c to read configuration. Dovecot v2.0 makes this a lot easier.
How about quota, can I let maildrop or dovecot (through the api) update it (I believe that let maildrop do that makes more sense)?
If you load quota plugin, Dovecot does it.
On Sep 2, 2009, at 9:28 PM, fernando@dfcom.com.br wrote:
Can I just "replace" the function called to save the message in the maildir (and update the indexes) by the dovecot one?
I don't know about maildrop code, but "maybe". But Dovecot doesn't
just have a "save message" function. You need to create at least:
- mail_user
- mail_namespaces
- mail_storage
- open the mailbox with mailbox_open()
- save the message using mailbox_save_*()
Anyway, look at src/lib-storage/mail-storage.h and how the rest of
Dovecot uses those.
Do I need to copy the code to load configuration when using only the api functions ?
If you don't care that it completely ignores dovecot.conf file and you
can figure out maildir location easily, then I guess it becomes easier.
participants (2)
-
fernando@dfcom.com.br
-
Timo Sirainen