Current time: 05-03-2024, 12:39 PM Hello There, Guest! (LoginRegister)


Post Reply 
Mail traffic accounting
Author Message
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #5
RE: Mail traffic accounting
After some brainstorming I've come up with this possible solution to the unaccounted forwarded messages, based on the fact that any incoming mail to a forwarded address will generate mail_size * number of forwarders bytes of outgoing mail:

1) build an in-memory table of (forwarded_address, n_recipients) at the beggning of traffic accounting.
2) For every incoming smtp check if the address is in the in-memory table. If it is, add size * n_recipients as traffic for this mail account.
3) Ignore any non-localdomain to non-localdomain delivery

Example with test case 4:
In-memory built table has a record (redir@dmn.tld, 1) because "redir@dmn.tld" is forwarded to 1 address.
Code:
2008-06-17 23:24:20 me@external.dmn redir@dmn.tld test.server.tld 127.0.0.1 SMTP - 1 778299
2008-06-17 23:24:20 me@external.dmn me@external.dmn test.server.tld mx.external.dmn SMTP - 1 778670
after-"modified awk script" (as after-awk we don't have the address anymore)
Code:
external.dmn dmn.tld 1556598
external.dmn external.dmn 778670 <- Ignored
Final count: 1556598 (778299 + 778299*1)
REAL count: 1556969 (778299 + 778670)
Comment: The missing bytes are those of the headers added by our mail server + mail filter.

This solution is far easier to implement than tracking queue-id's (have you ever tried to do this? there are times when logs are not in real processing order so you have references to not-yet-seen queue-id's and such...).

The overhead is also minimal, as there's only 1 extra query, a really short in-memory record for each forwarded address and a lookup for each incoming record.

Comments?
(This post was last modified: 06-18-2008 09:23 PM by kilburn.)
06-18-2008 09:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Mail traffic accounting - ispcomm - 06-13-2008, 11:09 PM
RE: Mail traffic accounting - ispcomm - 06-14-2008, 05:10 AM
RE: Mail traffic accounting - kilburn - 06-18-2008, 10:40 AM
RE: Mail traffic accounting - ispcomm - 06-18-2008, 05:33 PM
RE: Mail traffic accounting - kilburn - 06-18-2008 09:22 PM
RE: Mail traffic accounting - ispcomm - 06-18-2008, 11:16 PM
RE: Mail traffic accounting - kilburn - 06-19-2008, 12:57 AM
RE: Mail traffic accounting - ispcomm - 06-19-2008, 03:30 AM
RE: Mail traffic accounting - ispcomm - 06-19-2008, 04:46 AM
RE: Mail traffic accounting - kilburn - 06-19-2008, 06:25 AM
RE: Mail traffic accounting - kilburn - 06-19-2008, 08:30 AM
RE: Mail traffic accounting - ispcomm - 06-19-2008, 05:18 PM
RE: Mail traffic accounting - Zothos - 06-19-2008, 08:20 PM
RE: Mail traffic accounting - kilburn - 06-20-2008, 02:04 AM
RE: Mail traffic accounting - kilburn - 06-20-2008, 03:51 AM
RE: Mail traffic accounting - ispcomm - 06-20-2008, 07:31 AM
RE: Mail traffic accounting - kilburn - 06-20-2008, 09:34 AM
RE: Mail traffic accounting - ispcomm - 06-20-2008, 05:34 PM
RE: Mail traffic accounting - kilburn - 06-20-2008, 09:58 PM
RE: Mail traffic accounting - ispcomm - 06-20-2008, 11:54 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)