Hi there Amit,

> I require stats like these for each domain.
> 
> Total Mails sent :
> Incoming :
> Outgoing :
> Size of all mails sent :
> Incoming :
> Outgoing :
> Total bandwidth used:
> Incoming :
> Outgoing :
> 
> What are the important files in standard red hat installation from where
> such information can be extracted(using scripts or coupled commands)
> 

The most important files are /var/log/maillog* .

Now I am going to talk Perlish.

Create 3 hashes - from, to and size. The keys of each of these is 
the mail-id, some string that uniquely identifies the mail. You will
spot it instantly when you see the mail log files. To actually get at the 
values, you will have to regexp like /to.*@(.*)/ to get the domain to
which mail was sent. If $1 occurs in /etc/mail/local-host-names,
it is an incoming mail, else outgoing. Similarly for from. The size
is the easiest.

Now that you have created and populated the hashes, just dump
them out in tabular form.

One last problem. I think you would like this to be a daily cron job -
how much mail bandwidth did I use today etc etc. So you should use
the Date::Manip modules to parse the dates.

Regards,
-- Pai

          ================================================
To subscribe, send email to [EMAIL PROTECTED] with subscribe in subject header
To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in subject header
Archives are available at http://www.mail-archive.com/ilugd%40wpaa.org
          =================================================

Reply via email to