[Exim] logging traffic into a mysql db

Top Page
Delete this message
Reply to this message
Author: Caspar von Seckendorff
Date:  
To: exim-users
Subject: [Exim] logging traffic into a mysql db
Hi,

There are several virtual domains on my host with several non-system-user
cyrus accounts. I would like to log the amount of traffic that each user
creates. Domains, users, aliases & passwords are currently stored in a
mysql-db. It is used by an alias director and for smtp authentication when
relaying to the world.

I know how to execute mysql lookup-queries, but how can I simply execute an
SQL command under the condition that
1. the recipient is a local cyrus-user AND the sender is non-local
2. the sender is a cyrus-user and did not send the message from the local
host.

The sql-query would look sth like

"UPDATE accountuser SET inbytes = inbytes + $message_size WHERE username =
'${local_part:$key}'"

Hope someone can point me into the right direction.

-Caspar