I use an access policy server which mostly does rate-limiting and also writes to a database. It's written in perl. If all you want to do is to write some records for every connection then the script would be rather simple. You just need to put "check_policy_service unix:...." in the right place, presumably in smtpd_client_restrictions, I guess if you put it before permit_sasl_authenticated it would still have the auth details, due to delayed evaluation.
Thx, seems to be a good idea. I understand that Dovecot SASL does not support the Post-Login scripts. 2017-10-20 16:36 GMT+02:00 Gedalya <gedalya at gedalya.net>:> I use an access policy server which mostly does rate-limiting and also > writes to a database. > It's written in perl. > If all you want to do is to write some records for every connection then > the script would be rather simple. > You just need to put "check_policy_service unix:...." in the right place, > presumably in smtpd_client_restrictions, I guess if you put it before > permit_sasl_authenticated it would still have the auth details, due to > delayed evaluation. >
On 10/20/2017 04:50 PM, j.emerlik wrote:> I understand that Dovecot SASL does not support the Post-Login scripts.Yea, perhaps not. The concept it follows for POP3/IMAP is a wrapper for the executable launched to perform the actual service, and there is no such service when dovecot is only a SASL auth server for an external program. On the other hand a postfix policy server can let you record a lot of detail about SMTP activity: messages sent, sender/recipient addresses, and client addresses of course. I might be able to help with putting such a script together, time permitting :-)