Tue 06 Apr 2004
Category : Technology/MailStats.txt
Success. I'm now able to make the Xserve produce mail statistics like this :
Postfix log summaries for Apr 6
0 rejected (0%)
0 reject warnings
0 discarded (0%)
14483 bytes received
17981 bytes delivered
1 sending hosts/domains
4 recipient hosts/domains
... and lots more, including Per-Hour Traffic Summary, Host/Domain Summary: Message Delivery (top 150), Host/Domain Summary: Messages Received (top 150), top 100 Senders by message count, top 100 Recipients by message count, top 100 Senders by message size, top 100 Recipients by message size, message deferral detail, message bounce detail (by relay), message reject detail, message reject warning detail, message hold detail, message discard detail, smtp delivery failures, Warnings, Fatal Errors, Panics, and Master daemon messages.
They're everything a mail administrator would need. All these are generated by a piece of software called pflogsumm.pl by James S. Seymour. It is distributed under under the terms of the GNU General Public License as published by the Free Software Foundation.
I'm starting my exploration of Perl modules with pflogsumm because it's small, yet it does something very useful, and it's dependent on a Perl library called Date::Calc which, in turn, is dependent on a few other Perl modules.
The first question I was trying to solve is : how do we figure out precisely what Perl modules are needed? Until I discovered logGen, I didn't have a reliable way of knowing this. The second question is : now that I know which ones are needed, and where they need to be stored, can I simply copy them over to another machine, and have them work, even if I had not loaded the Developer Tools on this other fresh machine.? I've just proven that they will work. Which means that it is possible to build an installer that will automate all these activities. So, instead of taking about twenty minutes to do it manually, it will only take a few seconds to get this set up on any standard machine.
Which brings me to the next question. Let's say, I'm now able to conceive of a version of Postfix Enabler that will install all the things that are needed to run pflogsumm, and then provide the user with an interface that will generate mail statistics in all the variations that are built into pflogsumm, am I allowed to do that?
This is the next part of the learning process. We've got to check the license agreements for pflogsumm, as well as Date::Calc, and all its dependent modules. Plus trying to understand the implications of the GNU GPL and the concept of "copyleft". Does using pflogsumm mean that Postfix Enabler has to be released under the GPL, too? It's not something that I would mind and I had always thought that that was the consequence of the viral nature of the GPL. But I've just re-read the GPL and realised it's not necessarily so. So I'll learn something from this.
I remember the old Reebok tag-line, "Life is not a spectator sport". You learn deeper and faster when you throw yourself into the tackle.