I hope I am not of topic, but you can have a look on my implementation, using post login script feature of Dovecot. I am using an SQlite database to send a monthly report:
https://homebox.readthedocs.io/en/latest/email-access-monitoring/ An exemple is at the end of the page. Feel free to copy the code. André. PS: I am in holiday with limited access to my emails, but I saw I could hello here. Homebox: https://github.com/progmaticltd/homebox Thu Jul 11 10:11:34 GMT+02:00 2019 Lefteris Tsintjelis via dovecot <dovecot@dovecot.org>: > Is it possible to enable statistics and keep track of the maximum number > of connections per user and also per IP? > > Lefteris >