chaouche yacine
2017-Mar-28 16:50 UTC
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 : 1. mail is (always/sometimes) delivered with the dovecot-lda binary, which source code is in src/lda. 2. 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 3. mail_deliver function calls the deliver_mail function (it seems to be pointer to a function) 4. 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.
Steffen Kaiser
2017-Mar-29 10:44 UTC
Studying dovecot source code (searching for mail_deliver_hook_set)
-----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-----
Aki Tuomi
2017-Mar-30 06:14 UTC
Studying dovecot source code (searching for mail_deliver_hook_set)
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 KaiserAnd in particular, you want to look at src/plugins/quota/quota-maildir.c Aki