Re: [exim] Collecting Statistical data from a router to SQL

Top Page
Delete this message
Reply to this message
Author: Marcin Gryszkalis
Date:  
To: exim-users
Subject: Re: [exim] Collecting Statistical data from a router to SQL
I used something like that and I can confirm it worked well (lines broken so
don't forget to put \ here and there)

# updating traffic data, condition is always false
warn
#    domains = ! +local_domains
    authenticated = *
    condition = 
    ${lookup mysql {
            INSERT INTO traffic (username,domain,day,sent) 
values('${quote_mysql:${local_part:$authenticated_id}}','${quote_mysql:
${domain:$authenticated_id}}',date(now()),$message_size) 
            ON DUPLICATE KEY UPDATE sent=sent+$message_size 
            }{$value}fail}
    log_message = DEBUG traffic registered from 
$authenticated_id/$authenticated_sender ($sender_address): $message_size 
bytes


accept

--
Marcin Gryszkalis, PGP 0x9F183FA3
jabber jid:mg@???, gg:2532994
http://the.fork.pl