Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a CentOS 5.5 64 bit mail server using Postfix as the MTA.

I want to create a database of content and the time of mails sent and received from this mail server. Can anyone tell me how to do this?

share|improve this question
Do you mean the mail logs or the content of the emails? – Ladadadada Mar 14 '12 at 12:03
i meant the content of the emails plus the time of mail sent and received. – achal tomar Mar 14 '12 at 17:50
up vote 5 down vote accepted

Your question lacks detail, and thus my answer will be vague, too. I hope these hints can nudge you to right direction.

One way would be to use syslog-ng as your syslog-daemon and configure it in a way it pipes the mail logs to your own script, which then parses the results and inserts them to database. I've written couple of scripts like this in Perl.

Another way would be to use one of the log summarizers available:

share|improve this answer
ok i will try this and update you. – achal tomar Mar 14 '12 at 17:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.