On Tuesday, January 27, 2015, Wietse Venema <[email protected]> wrote: > > > This is typically done with "enable_long_queue_ids = yes", a program > that watches the maillog file, and a collection of regular expressions > that extract information. > > Thank you for tour reply. I know this option and i use it. But i do not want to parse log file. This will introduce some delay in processing and decision based on logged data. (For example, i want to monitor 5xx response ratio on individual sasl user names and block users in realtime - many 5xx errors is obviously indicator, that user send spam messages, so i can route it to another smtp client process with dedicate ip and/or block it)
Instead i want to hook some function in postfix (may be function which flushes records to log file?) and add couple of lines of code that connect to redis database and puts there some statistics. So i ask here, if someone with knowledge of postfix internals can tell me, what is the right place to add this code. What "function" to hook... I have read som source code of postfix and im not sure im able to identify right place to add my logging code) Thanks Tom
