Author: Ron White Date: To: exim-users Subject: [exim] Message logging with SQL
Good morning,
I'm looking at the concept of creating a message log database which
contains one line for each message that my Exim sees.
At this point I'm mostly guessing, but I suspect in the my various ACL
'drop' or 'deny' statements I could probably add something like:
set acl_m_nullthing = ${lookup mysql{INSERT INTO
maillog(recipient,sender,client_ip) VALUES ('${quote_mysql:$local_part}@
${quote_mysql:$domain}','foo','bar');}}
But I don't know how I would approach the problem of successful messages
that are not dropped, ie, have passed through a transport successfully.
Probably hoping to much, but I'd love to be able to log the message ID
and, where appropriate, the physical file name and location of the
delivered message in addition to the ip, to, from, subject.
I can probably hash up some kind of Perl script to trawl the logs at a
preset interval and populate a database, but it would be much 'nicer' if
I could do it as the message rolls through Exim.
Anyone know if it's possible to do this? Forgive me if the question is
stupid - but I'm not the sharpest knife in the drawer ;-)