Logging number of pop3's email retrieved during a connection - was (IMAP/POP traffic accounting)

Anthony Tibbs anthony-list at tibbs.ca
Fri Nov 21 14:27:07 EST 2008


Hi Eddy,

I had worked on this briefly and, given a day or so, I could probably come 
up with a working solution at least for byte/traffic accounting.  Logging 
'messages retrieved' for POP3 could make some sense, but it gets complicated 
with clients using "TOP" to partially retrieve messages for inspection, and 
in the IMAP world its all but meaningless (since that might involve copies 
to folders, etc.).

For pure traffic accounting purposes, though, that isn't so hard, 
particularly if you don't want it saved in a database anywhere, but merely 
added as a log entry.

I might not have a chance to look at this until December though. 
Cyrus/software development is something of a side job for me, as I'm 
actually a third year student in McGill's Faculty of Law.  But I will work 
on getting this done (since I need it nowadays anyway) for traffic 
accounting on IMAP/POP3 at the very least...

Take care,
Anthony


----- Original Message ----- 
From: "Eddy Beliveau" <eddy.beliveau at hec.ca>
To: "Mirosław Jaworski" <mjaw at ikp.pl>
Cc: <info-cyrus at lists.andrew.cmu.edu>; <anthony-list at tibbs.ca>
Sent: Friday, November 21, 2008 2:12 PM
Subject: Logging number of pop3's email retrieved during a connection - was 
(IMAP/POP traffic accounting)


> Hi! Netfriends,
>
> I sent this email last week but didn't received any replies.
>
> So, I would like to spin it again... Maybe my title was obscure.  ;-)
>
>
>
> I would like to log some statistics when any user retrieves their pop3's 
> emails.
>
> Currently:
> ... pop3[32760]: login: address [ip] user plaintext User logged in
>
> It would be nice to also get the number of messages retrieved (and total 
> size if available)
>
>
> Can someone help ?
>
> Thanks,
> Eddy
>
> -------- Message original --------
> Sujet : Re: IMAP/POP traffic accounting
> De : Eddy Beliveau <eddy.beliveau at hec.ca>
> Pour : Mirosław Jaworski <mjaw at ikp.pl>
> Copie à : info-cyrus at lists.andrew.cmu.edu
> Date : 2008-11-13 11:51
>
>> Hi!
>>
>> By browsing archives, I find this current thread.
>>
>> We are using cyrus-imapd 2.2.13 and it works well  :-)
>>
>> I would also like to add statistics to pop3d.c
>>
>> Can you please provide the patch that was used to get this:
>> Nov 30 16:27:31 mail1 pop3[19762]: stats: t63877a 8 663454 0 0
>>
>> It would be valuable to our helpdesk staff.
>>
>> Many thanks,
>>
>> Have a nice day
>> Eddy
>>
>> -------- Message original --------
>> Sujet : Re: IMAP/POP traffic accounting
>> De : Mirosław Jaworski <mjaw at ikp.pl>
>> Pour : Anthony Tibbs <anthony-list at tibbs.ca>
>> Copie à : info-cyrus at lists.andrew.cmu.edu
>> Date : 2006-11-30 10:35
>>
>>> On Wed, 2006-11-29 at 13:23 -0500, Anthony Tibbs wrote:
>>>> I believe there was some mention of this in the past, but I'm wondering 
>>>> whether there are any known efforts to implement network traffic 
>>>> accounting in the later versions of Cyrus, or if this is still 
>>>> something that hasn't been dealt with.  I am pondering possibly 
>>>> tackling this, but I'm not really familiar with the Cyrus code and 
>>>> would rather not reinvent the wheel if it's already in the works.
>>> Well, 'effort' is definitely too big word for the hack we use.
>>> Our support was used to some old popper log format, so we have made
>>> hack resulting in such lines:
>>>
>>> User who (downloaded and) deleted 8 messages, 663454 bytes total.
>>>
>>> Nov 30 16:27:16 mail1 pop3[19762]: login: [83.15.90.206] t63877a
>>> plaintext User logged in
>>> [...]
>>> Nov 30 16:27:31 mail1 pop3[19762]: stats: t63877a 8 663454 0 0
>>>
>>> User who didn't (downloaded and) deleted any messages; has 35 messages
>>> in his INBOX, 10785042 bytes total:
>>>
>>> Nov 30 16:18:59 mail1 pop3[19360]: login: [83.31.77.74] po30533
>>> plaintext User logged in
>>> [...]
>>> Nov 30 16:19:00 mail1 pop3[19360]: stats: po30533 0 0 35 10785042
>>>
>>>
>>> While it makes sense to have such logs from pop3 daemon doing simple
>>> operations on only one folder it has none when it comes to IMAP.
>>> What log can i possibly create after user connects to imap, applies
>>> his rules to an INBOX ( moving most of the messages to various folders,
>>> ie. marking them for deletion, not deleting them )? What when he reads
>>> some messages without deleting them?
>>>
>>> M.
>>>
>>
>
> -- 
> Eddy Beliveau
> HEC Montreal
> Montreal (Quebec)
> Canada
> 



More information about the Info-cyrus mailing list