Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Please help me to resolve this problem. I want to store Postfix sent details into My Sql DB. Already create the table and everything but somehow unable to create the relationship between postfix and My Sql. So each time a user sent a mail his data such as user Id , send mail, destination mail, IP etc. get stored into My Sql .

share|improve this question

1 Answer 1

You can make it with content filter. Simply each mail will be delivered via stdin to the script, which will extract headers and save into db. Not sure if you would also check the From and To to make sure you process only outbound mail as you say.



You need to find out what suits you best. You will need to fiddle with main.cf and master.cf, create script like in Perl, PHP, Python and there you go, it's not that hard. The email header finishing after double enter like \r\n\r\n or \n\n

This really depends on your existing configuration as well, like spam and virus checking, if you got this, you could hook this up in the chain (after virus and spam check, for example).

share|improve this answer

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.