Studying dovecot source code (searching for mail_deliver_hook_set)
Hello dovecot,
I would like to study how dovecot manages quota, especially how it deals with the maildirsize file if one chooses to implement quota according to the maildir++ specification.
I made a number of assumptions :
mail is (always/sometimes) delivered with the dovecot-lda binary, which source code is in src/lda.
mail is sent with the mail_deliver function which is called from src/lda/main.c and is defined in src/lib-lda/mail-deliver.c
mail_deliver function calls the deliver_mail function (it seems to be pointer to a function)
according to src/lib-lda/mail-deliver.h, deliver_mail is set with the mail_deliver_hook_set function. Here's what the comment says
/* Sets the deliver_mail hook and returns the previous hook, which the new_hook should call if it's non-NULL. */ deliver_mail_func_t *mail_deliver_hook_set(deliver_mail_func_t *new_hook);
The problem at this point is that I can't find where is this function called. A grep on the sources only reveals two results :
-*- mode: grep; default-directory: "~/DOWNLOADS/APPS/dovecot-2.2.13/src/" -*- Grep started at Tue Mar 28 17:01:50
grep -nH -e 'mail_deliver_hook_set' -r . ./lib-lda/mail-deliver.c:428:deliver_mail_func_t *mail_deliver_hook_set(deliver_mail_func_t *new_hook) ./lib-lda/mail-deliver.h:103:deliver_mail_func_t *mail_deliver_hook_set(deliver_mail_func_t *new_hook);
Grep finished (matches found) at Tue Mar 28 17:01:50
According to the changelog this function has been introduced back in 2010. I don't know if it's really used ?
I am working on the 2.2.13 sources because that's what's installed on my server.
I couldn't find a developers mailling listed in http://www.dovecot.org/mailinglists.html so I'm just posting this here.
-- Yassine.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 28 Mar 2017, chaouche yacine wrote:
I would like to study how dovecot manages quota, especially how it deals with the maildirsize file if one chooses to implement quota according to the maildir++ specification.
Quota is managed by the plugin, which hooks into some events. Check out
src/plugins/quota
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBWNuP93z1H7kL/d9rAQKcXwf7BkeKmu6C1PVDQxaZ87oQwGqnuwdmj/hI EEFdlqehBZ0qWdHAvfQqXnQpu3gNB+zZINoj109r/8r1I+N96bCW8zY9WArqk3qw 6JbrMqLLw/v0BnBZqfVXGodj/YHrNzAUDVUhBbTL77+T7wbjZJYssHFAxEFXraKq Y+Ypg1PLGXLvhaFbUlUuLqtngn5zTTMRD5zJvsaiBrN1l57yi0LX1QqGeVcyPT2e +00Zg11Cv6mhqOW3GqjH1SIU2UZ+V/M/AGwgHoMVetfRu8iKJTbanerl3cXJFi1D q+jrbxt3rAOH9FJZGVNpGiQ25Iayx/gU3u7qEOtTEg6jLJLVIvZRFQ== =qpgG -----END PGP SIGNATURE-----
On 29.03.2017 13:44, Steffen Kaiser wrote:
On Tue, 28 Mar 2017, chaouche yacine wrote:
I would like to study how dovecot manages quota, especially how it deals with the maildirsize file if one chooses to implement quota according to the maildir++ specification.
Quota is managed by the plugin, which hooks into some events. Check out
src/plugins/quota
-- Steffen Kaiser
And in particular, you want to look at src/plugins/quota/quota-maildir.c
Aki
Thanks ! I don't know if there's documentation about dovecot's design as a whole, not the details of the plugin itself, to get the big picture ? I assume the plugins are loaded in a loop at dovecot startup, or at login, or when mail is delivered via lda/lmtp ? in the particular case of the quota plugin I assume the quota functions are called from LMTPD (since this is how I configured postfix to talk to dovecot) ? should I look in LMTPD's source code to find the function that calls the plugin ?
-- Yassine.
On Thursday, March 30, 2017 7:15 AM, Aki Tuomi <aki.tuomi@dovecot.fi> wrote:
On 29.03.2017 13:44, Steffen Kaiser wrote:
On Tue, 28 Mar 2017, chaouche yacine wrote:
I would like to study how dovecot manages quota, especially how it deals with the maildirsize file if one chooses to implement quota according to the maildir++ specification.
Quota is managed by the plugin, which hooks into some events. Check out
src/plugins/quota
-- Steffen Kaiser
And in particular, you want to look at src/plugins/quota/quota-maildir.c
Aki
https://wiki2.dovecot.org/Design
Aki
On 30.03.2017 12:35, chaouche yacine wrote:
Thanks ! I don't know if there's documentation about dovecot's design as a whole, not the details of the plugin itself, to get the big picture ? I assume the plugins are loaded in a loop at dovecot startup, or at login, or when mail is delivered via lda/lmtp ? in the particular case of the quota plugin I assume the quota functions are called from LMTPD (since this is how I configured postfix to talk to dovecot) ? should I look in LMTPD's source code to find the function that calls the plugin ?
-- Yassine.
On Thursday, March 30, 2017 7:15 AM, Aki Tuomi <aki.tuomi@dovecot.fi> wrote:
On 29.03.2017 13:44, Steffen Kaiser wrote:
On Tue, 28 Mar 2017, chaouche yacine wrote:
I would like to study how dovecot manages quota, especially how it deals with the maildirsize file if one chooses to implement quota according to the maildir++ specification.
Quota is managed by the plugin, which hooks into some events. Check out
src/plugins/quota
-- Steffen Kaiser And in particular, you want to look at src/plugins/quota/quota-maildir.c
Aki
Perfect ! thanks a lot :)
On Thursday, March 30, 2017 10:42 AM, Aki Tuomi <aki.tuomi@dovecot.fi> wrote:
https://wiki2.dovecot.org/Design
Aki
On 30.03.2017 12:35, chaouche yacine wrote:
Thanks ! I don't know if there's documentation about dovecot's design as a whole, not the details of the plugin itself, to get the big picture ? I assume the plugins are loaded in a loop at dovecot startup, or at login, or when mail is delivered via lda/lmtp ? in the particular case of the quota plugin I assume the quota functions are called from LMTPD (since this is how I configured postfix to talk to dovecot) ? should I look in LMTPD's source code to find the function that calls the plugin ?
-- Yassine.
On Thursday, March 30, 2017 7:15 AM, Aki Tuomi <aki.tuomi@dovecot.fi> wrote:
On 29.03.2017 13:44, Steffen Kaiser wrote:
On Tue, 28 Mar 2017, chaouche yacine wrote:
I would like to study how dovecot manages quota, especially how it deals with the maildirsize file if one chooses to implement quota according to the maildir++ specification.
Quota is managed by the plugin, which hooks into some events. Check out
src/plugins/quota
-- Steffen Kaiser And in particular, you want to look at src/plugins/quota/quota-maildir.c
Aki
participants (3)
-
Aki Tuomi
-
chaouche yacine
-
Steffen Kaiser