Dean Staff <[EMAIL PROTECTED]> wrote:
> 
> I've managed to get qmail to log the pop connections using a poplog  
> script that contail s the following... 
[...]
> I need to be able to log the STAT output also. (how many unread  
> message are in the user mailbox, and total size of all that users new 
>  mail files) I have been unsuccessful in trying to get this info 
> added  to the log. I'd to get it on the same line as as the userid if 
>  possible. Would you have any suggestions. 

Either expand your little POP3-logging shim, or write an additional one that
comes just before qmail-pop3d in your run script.  Since you're serving your
mail out of Maildirs in the user's home directories, finding the number of
messages and total bytes in new/old mail is trivial:

oldmessages=`ls $USER/Maildir/old/ | wc -l`
newmessages=`ls $USER/Maildir/new/ | wc -l`
newmailbytes=`du -sb $USER/Maildir/new/ | cut -f 1`

Then print this as you do your current logging information.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon                            <[EMAIL PROTECTED]>
GPL'ed software available at:  http://www.qcc.sk.ca/~charlesc/software/
Any opinions expressed are just that -- my opinions.
-----------------------------------------------------------------------

Reply via email to