[Dovecot] Developer docs?
Hi,
I'm looking to modify Dovecot slightly to add support for a custom feature. I've spent some time reading the code, and I've been wondering if there are any contributor/developer documents I've missed that would make getting up to speed easier.
I've read much of the code, and most of the wiki, including the Design/* and /*Process pages. They give a good summary of some of the design decisions, but I don't see much other than that. The docs included in the tarball are just dumps of the wiki pages.
I've browsed some of the list archives as well, without finding much to help me.
Are there other resources I've missed? What I'm trying to do requires passing some additional information/state from the imap-login process (presumably through the master) to the imap mail process. Any pointers much appreciated!
Thanks,
C.
C. Mills
On 25.8.2013, at 21.09, C. Mills dovecot@pyropus.ca wrote:
I'm looking to modify Dovecot slightly to add support for a custom feature. I've spent some time reading the code, and I've been wondering if there are any contributor/developer documents I've missed that would make getting up to speed easier.
I've read much of the code, and most of the wiki, including the Design/* and /*Process pages. They give a good summary of some of the design decisions, but I don't see much other than that. The docs included in the tarball are just dumps of the wiki pages.
I've browsed some of the list archives as well, without finding much to help me.
Are there other resources I've missed?
Nope. Maybe the docs will increase some day when there's more time and developers.
What I'm trying to do requires passing some additional information/state from the imap-login process (presumably through the master) to the imap mail process. Any pointers much appreciated!
See how imap-login/client-authenticate.c imap_client_auth_begin() sends the command tag to imap process. Or if it's something all login processes need you could modify struct master_auth_request directly.
Timo Sirainen tss@iki.fi wrote:
On 25.8.2013, at 21.09, C. Mills dovecot@pyropus.ca wrote:
Are there other resources I've missed?
Nope. Maybe the docs will increase some day when there's more time and developers.
It's a real chicken-and-egg problem, that's for sure.
See how imap-login/client-authenticate.c imap_client_auth_begin() sends the command tag to imap process. Or if it's something all login processes need you could modify struct master_auth_request directly.
Okay, thanks for the pointer. /me continues digging
C.
C. Mills
Timo Sirainen tss@iki.fi wrote:
On 25.8.2013, at 21.09, C. Mills dovecot@pyropus.ca wrote:
What I'm trying to do requires passing some additional information/state from the imap-login process (presumably through the master) to the imap mail process. Any pointers much appreciated!
See how imap-login/client-authenticate.c imap_client_auth_begin() sends the command tag to imap process. Or if it's something all login processes need you could modify struct master_auth_request directly.
I do see how it's put into the imap_client->common.master_data_prefix there, but it's not clear to me how to get it back *out* in the imap mail client. The only place I see that data actually used is in /login-common/sasl-server.c.
For a concrete example, I'd like to pass an additional string/char * of state information from the imap-login code to imap mail client code. I think, based on the above, that you suggest putting it into the imap_client->common struct, which I've done, so that struct is then passed to client_auth_begin(), and presumably goes to the master process. But where does that information/data get passed to the imap mail client? For example, if I wanted to access it in /imap/cmd-fetch.c : cmd_fetch(), cmd->client appears to be a different structure?
Thanks,
C. C.
C. Mills
On 27.8.2013, at 2.19, C. Mills dovecot@pyropus.ca wrote:
See how imap-login/client-authenticate.c imap_client_auth_begin() sends the command tag to imap process. Or if it's something all login processes need you could modify struct master_auth_request directly.
I do see how it's put into the imap_client->common.master_data_prefix there, but it's not clear to me how to get it back *out* in the imap mail client. The only place I see that data actually used is in /login-common/sasl-server.c.
In imap-login process write it to master_data_prefix. This gets passed through to imap process directly, which reads it in imap/main.c : client_parse_input(). You can use whatever format in there as long as the reading and writing part are compatible with each others. Note that after the master_data_prefix may come some actual IMAP client input that needs to be parsed. So you'll probably want to add your extra string before or after the imap tag string.
For a concrete example, I'd like to pass an additional string/char * of state information from the imap-login code to imap mail client code. I think, based on the above, that you suggest putting it into the imap_client->common struct, which I've done, so that struct is then passed to client_auth_begin(), and presumably goes to the master process. But where does that information/data get passed to the imap mail client? For example, if I wanted to access it in /imap/cmd-fetch.c : cmd_fetch(), cmd->client appears to be a different structure?
I'm beginning to wonder if another way would be better. Why does the data need to be passed before login, why can't it be passed after login so there wouldn't need to be any imap-login <-> imap communication for it?
Or if the information you're passing is coming from an external source and not exactly from the IMAP client, maybe you can get it from auth process userdb lookup? Those fields are also passed to imap process.
participants (2)
-
C. Mills
-
Timo Sirainen