[OT] Mail user bandwidth monitoring

Furnish, Trever G TGFurnish at HERFF-JONES.COM
Fri Nov 14 18:26:10 GMT 2003

Iptables can filter based on user, so long as it's a local account on the
machine, and you can use a logging only rule to do that for accounting.
Never actually tried it, doubt it scales all that well, and it would only
account for network traffic tied to a process that runs as the actual user
(which MTAs won't).

I think this type of thing would be highly application-specific, so doing it
at the kernel level is likely to be a bad approach.

For email, if you modify your definition of "bandwidth" slightly, then the
sql logging done by mailscanner in support of mailwatch includes the size of
each message, so calculating the total message-related bandwidth (at least
on a relay-only, no local accounts box) is a simple sql query.  Or you can
do it in the mailwatch reports interface by limiting the report to one user.

But again, for email such reporting is not only application specific, but
highly situation-specific.  For example, if you have local user accounts on
the system, then letting them send mail to each other will log messages into
the sql database, but the messages don't consume network bandwidth because
the message never leaves the system.  For another example, you'd need to
narrowly define what constitutes "user-bandwidth" - what do you do with a
message from one user to several others?  If you add the message as
bandwidth usage for all recipients, then you'll end up thinking you used
more bandwidth than you even own.

I think the simplest situation is probably one where your mailscanner
handles ONLY inbound messages (mail from outside your domain to someone @
your domain) and is only a relay (ie has no local user accounts that receive

> -----Original Message-----
> From: Dee Lowndes [mailto:dee at ASYOUNEED.COM]
> Sent: Friday, November 14, 2003 1:00 PM
> Subject: Re: [OT] Mail user bandwidth monitoring
> > -----Original Message-----
> > From: MailScanner mailing list
> > Behalf Of Martin Hepworth
> > Sent: 14 November 2003 17:21
> > Subject: Re: [OT] Mail user bandwidth monitoring
> >
> > Dee Lowndes wrote:
> >
> > > Does anyone know of a way to monitor a mail user's bandwidth usage
> or
> > > even better a package that can monitor bandwidth usage
> for a user no
> > > matter what the service hosted on a Linux/Unix server?
> > >
> > > Cheers,
> > > Dee
> >
> > Depends on how the user is identified. Probably looking at something
> > very expensive for sure to do kernal level resource
> auditing. CA / IBM
> > prob have something .
> >
> There is bound to be an Open source project or two somewhere that does
> it as ISP's all monitor their clients usage of bandwidth for charging
> purposes.
> Dee

More information about the MailScanner mailing list