[Exim] calculating bandwidth used by auth. smtp users

Top Page

Reply to this message
Author: Matthew Nuzum
Date:  
To: exim-users
Subject: [Exim] calculating bandwidth used by auth. smtp users
(sorry if this comes through twice, the first time is waiting moderator
    approval due to being sent from the wrong account)


Hey all, maybe there's a good solution out there, but I couldn't find it.

Increasingly, larger DSL ISPs such as Verizon and Bell South have been
pulling a dirty trick by not providing SMTP services to business customers
unless their website and e-mail is also hosted through them. They say
"What? Your web-hosting provider doesn't offer that? Well, we believe all
good hosting providers should offer that, move your site over to us..."

This is very frustrating and we've already lost some customers because we
couldn't be open relays. Well, we installed an Exim server and found it was
easy to set up authenticated SMTP so we've begun offering that to those
customers who need it.

In order to keep track of our costs, we needed a way to see how much
bandwidth they're using.  A colleague and I threw together a quick log
reporting hack that will display the user and the size of the e-mail
messages they've sent through us.  It spits out a tab separated list in the
format of:
Date/Time    Username    Message Size


This can easily be processed by RDBMs or Excel or whatever else is needed.

Here's is what we run at the bash prompt to get our data:

cat mainlog.0 | grep login | cut --delimiter=" " -f 1,2,10,11 | awk '/login/
{ split($3,LoginID,":"); split($4,Size,"="); print
$1,$2,"\t",LoginID[2],"\t",Size[2]}'

FYI, the -f 1,2,10,11 gets the fields DATE (1), TIME (2), USER (10),
SIZE(11)

Maybe someone has an alternate solution or suggested enhancement.
Otherwise, it's an item for the mailing list archives so that the next
person who needs it doesn't have to start from scratch.

Here are some of the search words I tried to find something useful:
Exim smtp auth log logfile report bandwidth usage

Matthew Nuzum        | ISPs: Make $200 - $5,000 per referral by
www.followers.net        | recomending Elite CMS to your customers!
matt@???    | http://www.followers.net/isp