Bandwidth Logging

Use this forum if you want to suggest a new feature to hMailServer. Before posting, please search the forum to confirm that it has not already been suggested.
Post Reply

Do you need this feature?

Yes
40
87%
No
6
13%
 
Total votes: 46

tocpcs
New user
New user
Posts: 12
Joined: 2008-02-26 13:58

Bandwidth Logging

Post by tocpcs » 2008-03-08 10:07

Logging bandwidth usage for each email account for SMTP and POP3 access.

I think this would be handy so that it can be seen what bandwidth is attributed to email account usage.

And it could have an 'other' view, so that emails that aren't delivered (or brute forcing, etc) can be placed in a seperate counter to be tallied.

Bandwidth logging, please?

tocpcs
New user
New user
Posts: 12
Joined: 2008-02-26 13:58

Post by tocpcs » 2008-03-15 11:37

Anyone else interested in bandwidth logging?

It could simply be logging the data size of each message in or out from a user, and maintaining that for each email address?

mvanniek
New user
New user
Posts: 1
Joined: 2008-11-14 13:52

Re: Bandwidth Logging

Post by mvanniek » 2008-11-14 13:58

Absolutely!

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Bandwidth Logging

Post by maggiore81 » 2009-04-22 10:50

I have implemented awstats to log the hmailserver activity
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

User avatar
pepsi
Senior user
Senior user
Posts: 419
Joined: 2008-08-21 20:58
Location: Netherlands

Re: Bandwidth Logging

Post by pepsi » 2009-04-22 15:51

AWstats is great 1 problem.
if i send a message to 10 recipients in 2 domains. it will count the bandwith of the message times 10. instead of times 2

black zero
Normal user
Normal user
Posts: 111
Joined: 2008-08-01 15:26

Re: Bandwidth Logging

Post by black zero » 2009-04-26 12:41

Voted yes.

I am more than happy to do that. :D

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Bandwidth Logging

Post by ^DooM^ » 2009-07-22 01:21

This would come under SNMP support.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Shiloh
Normal user
Normal user
Posts: 163
Joined: 2006-04-14 00:00

Re: Bandwidth Logging

Post by Shiloh » 2009-07-24 17:25

I would love an easy way to track bandwidth per mailbox and per domain. That would be awesome. It would really help us monitor for abuse. It would terrific if there were a few fields in the DB for tracking these things and some methods in the COM object for accessing the tracking metrics on a per user and per domain level.

Additionally, SNMP support for tracking server level metrics would be handy. We would not need per mailbox things exposed to SNMP, though.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Bandwidth Logging

Post by martin » 2009-07-24 17:42

It's hard for hMailServer to measure it's own bandwidth properly. It would be possible to measure the amount of data transmitted, but Windows will add data on top of that (routing information, checksums, source/destination info etc). And hMailServer doesn't know how Windows splits up the data it sends into individual packets and I don't think there's a way to detect it without some sort of coding which would be outside the scope of hMailServer. (Plus, the amount of data will differ depending on whether IPv4/v6 is used.)

Also, what if an external person sends a message to two internal users. Should those two pay for half of those bytes each?

User avatar
pepsi
Senior user
Senior user
Posts: 419
Joined: 2008-08-21 20:58
Location: Netherlands

Re: Bandwidth Logging

Post by pepsi » 2009-07-24 19:12

I would be happy if instead off bandwith the message size would be used to specific hosts

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Bandwidth Logging

Post by ^DooM^ » 2009-07-24 19:35

I think an approximate value would suffice to be honest. Do it in octets just to confuse people ;)
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Shiloh
Normal user
Normal user
Posts: 163
Joined: 2006-04-14 00:00

Re: Bandwidth Logging

Post by Shiloh » 2009-07-26 19:06

Just use the message size to tally bandwidth. The bandwidth total would not be an exact representation of the actual bandwidth used, but it would definitely be close enough.

On a message sent from an external person to two internal addresses, use the message size to apply to both internal addresses. You don't need to split the number. If a message is 10k and two people received it, add 10k to the inbound bandwidth total for both users.

The main reason I want this feature is to track abuse. Even if the numbers are not perfect measurements of actual bandwidth usage, we would still be able to spot abuse quickly. This makes it possible for me to close accounts that are violating TOS, and charge some users more who are legitimately using more resources.

Here are the metrics that I would like to see:
1) Bandwidth in per user
2) Bandwidth out per user
3) Number of messages received per user
4) Number of messages sent per user
5) Bandwidth in per domain
6) Bandwidth out per domain
7) Number of messages received per domain
8) Number of messages sent per domain

The per domain metrics would not need to be tracked. The per domain metrics could simply be generated using the per user metrics. Additionally, there could be a few different time periods to track for. Maybe daily, monthly, etc.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Bandwidth Logging

Post by martin » 2009-07-27 18:08

Just use the message size to tally bandwidth. The bandwidth total would not be an exact representation of the actual bandwidth used, but it would definitely be close enough.
I don't agree that that is close enough. If you're using IMAP, the bandwidth just for the IMAP protocol may be comparable with the size of the messages the user receives. Sure, if your only goal is to track abuse than it won't be good enough. But I'm not going to implement a bandwidth meter which guesstimates bandwidth which may be 50% less than the actual used...

luci
Normal user
Normal user
Posts: 70
Joined: 2008-02-29 14:29
Location: Romania

Re: Bandwidth Logging

Post by luci » 2009-09-17 11:06

So It would be hard to sum the length of data flowing to the socket connection for each user/domain ?
Radical Image Optimization Tool developer
Project Manager at CRIOSWEB

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Bandwidth Logging

Post by sheffters » 2009-09-17 12:58

http://hmaillive.ianbradshaw.co.uk/traffic.cgi

does some basic logging ... it has the problems listed above (re multiple mails and the like) ... but maybe a start without having to actually log network traffic.

S.

luci
Normal user
Normal user
Posts: 70
Joined: 2008-02-29 14:29
Location: Romania

Re: Bandwidth Logging

Post by luci » 2009-09-17 14:08

It is very good. Will you publish it?
Radical Image Optimization Tool developer
Project Manager at CRIOSWEB

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Bandwidth Logging

Post by sheffters » 2009-09-17 14:19

I've open sourced it.

You can get it from http://forum.ianbradshaw.co.uk

I run it on hmail 5.1.2, but people have it working with later versions without change, just I haven't tested it yet.

Needs Perl and a few modules, so check the pre-requisits on there.

S.

luci
Normal user
Normal user
Posts: 70
Joined: 2008-02-29 14:29
Location: Romania

Re: Bandwidth Logging

Post by luci » 2009-09-17 18:50

thanks for making this public :)
Radical Image Optimization Tool developer
Project Manager at CRIOSWEB

Post Reply