A few days ago, I asked about "Metering POP related email traffic?"
on this list.
Markus Stumpf <[EMAIL PROTECTED]> suggested me to patch
qmail-pop3d.c to output the number of bytes on every successfull
"RETR" command (probably to STDERR). Today, I got some spare time, so
I took a look of qmail-pop3d.c. I think overall it's quite easy to
come up *most of* the patch.
Basically, I would introduce a global long, and then use it to count
bytes sent out by blast(), and then write out the bytesread in
pop3_quit().
However, it's at the last stage I ran into an problem. I was trying
not to use syslog for logging. But it seems to be that I can't write
the logged info to STDERR, since the info would be sent to POP client
(I confirmed this using telnet to port 110).
Right now, I invoke qmail-pop3d in the following manner:
[...]
'start_popd')
#
# start pop server
#
if [ -f $RULESDIR/pop3.cdb ]; then
env - PATH="/var/qmail/bin:/usr/local/bin:$PATH" \
tcpserver \
-v -R -x $RULESDIR/pop3.cdb \
0 pop3 qmail-popup $HOSTNAME \
$checkpassword qmail-pop3d Maildir 2>&1 \
| $setuidgid qmaill $tai64n 2>&1 \
| $setuidgid qmaill $multilog /var/log/pop3d &
[...]
At this stage, I don't see a way of using multilog shown above for
logging. I really would like to get this patch free of syslog, and
thus would be very appreciative for any tips.
Regards,
Chin Fang
[EMAIL PROTECTED]