How do you gather statistics for messages delivered and processed via
Postfix (both inbound and outbound)? For instance, to show on a daily
basis, how many messages we have received from each domain, how many
messages we have delivered to each domain, etc.
I have seen some options relying on passing the maillog file, I wonder
if there is any other option?
Thanks,
Yan
Confidentiality Notice: The information contained in this electronic transmission is confidential and may be legally privileged. It is intended only for the addressee(s) named above. If you are not an intended recipient, be aware that any disclosure, copying, distribution or use of the information contained in this transmission is prohibited and may be unlawful. If you have received this transmission in error, please notify us by telephone (513) 229-5500 or by email (postm...@MedPlus.com). After replying, please erase it from your computer system.
You have to write script or download something.
external : grep on "relay=" and sent excluding local domains.
internal : grep on "relay=local" or where ever the mail store is.
cut, sort and uniq work well for this in Bash.
How do you gather statistics for messages delivered and processed via
Postfix (both inbound and outbound)? For instance, to show on a daily
basis, how many messages we have received from each domain, how many
messages we have delivered to each domain, etc.
I have seen some options relying on passing the maillog file, I wonder
if there is any other option?
On Fri, 15 Apr 2011 14:08:30 +0200
Zoltan Balogh <zee.b...@gmail.com> wrote:
> 2011/4/12 Zhou, Yan <yz...@medplus.com>
>
[snip]
> > I have seen some options relying on passing the maillog file, I
> > wonder if there is any other option?
> >
[snip]
I'm curious: How might one gather and process mail server statistics
*other* than parsing and processing the mail server's log file(s)?
Regards,
Jim
--
Note: My mail server employs *very* aggressive anti-spam
filtering. If you reply to this email and your email is
rejected, please accept my apologies and let me know via my
web form at <http://jimsun.LinxNet.com/contact/scform.php>.
> I'm curious: How might one gather and process mail server statistics
> *other* than parsing and processing the mail server's log file(s)?
The server could be gathering stats (snmp style) in a "stats" daemon
(which is, like qmgr, long running). Upon stop it would write
statistics to a database file (or into a real database) and would
reload the counters from the upon restart.
--
Ralf Hildebrandt
Geschäftsbereich IT | Abteilung Netzwerk
Charité - Universitätsmedizin Berlin
Campus Benjamin Franklin
Hindenburgdamm 30 | D-12203 Berlin
Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
ralf.hil...@charite.de | http://www.charite.de
>
>
> Am 15.04.2011 15:06, schrieb James Seymour:
> > I'm curious: How might one gather and process mail server statistics
> > *other* than parsing and processing the mail server's log file(s)?
>
> Query amavis snmp agent. It keeps track of Postfix queue status if it
> finds Postfix queues.
Would that provide the information the OP was seeking?
> * James Seymour <jsey...@LinxNet.com>:
>
> > I'm curious: How might one gather and process mail server statistics
> > *other* than parsing and processing the mail server's log file(s)?
>
> The server could be gathering stats (snmp style) in a "stats"
> daemon ...
[snip]
Could be, but isn't. Besides which: If the stats were comprehensive,
just imagine the memory usage. Or it'd have to stash them in some kind
of database store all along, which might have performance implications,
might it not?
Serious questions/concerns. Not trying to be argumentative.
Well, like anvil right now, or more like postscreen, which also stores
a metric assload of data.
Use pflogsumm.pl - it's a standard of sorts.
http://linxnet.com/postfix_contrib.html
> For instance, to show on a daily
> basis, how many messages we have received from each domain, how many
> messages we have delivered to each domain, etc.
>
I use awstats for that:
http://awstats.sourceforge.net/
You'll have to twiddle for a few hours to get it to do email, but it is
actually supported out of the box.
> I have seen some options relying on passing the maillog file, I wonder
> if there is any other option?
>
No.
You'll have to consider WHY you want these statistics - then focus on
getting exactly the data you require.
Nothing prevents you from sending all mail through a custom milter or
policy service that merely counts messages, after all.
--
J.