My first idea was to
monitor the log file with a daemon and search for strings like
"deliver(x...@y.z): 2010-11-15 17:34:56 Info:
msgid=<aanlktikorguieg2kguw2glmuld4tx-bpst4yhubuh...@a.b>". I'm not sure
if this is the right approach. Does anyone know a better solution with
Configure your MTA to log into an SQL database. Then you can pull
everything you want from there
The IMAP server is the wrong place for that as you would exclude mails
that get discarded by the MTA, e.g. due to ingress or spam detection
rules or because of a misconfigured alias.
HTH,
Jakob Curdes