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

I have a postfix setup for my web server and I want to store every outgoing email from the server to a database. Does any one know how I can achieve this. FYI I just use this server to send emails and I use google Apps to receive emails.

share|improve this question

migrated from stackoverflow.com Feb 5 '12 at 0:20

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

Youre going to have to do several things

  1. Use the always_bcc setting to fork a copy of the emails to an alternate destination (what you use really doesnt matter, this is just for item #3 below)
  2. Set up a pipe transport in your master.cf file which will receive the emails and store them in the database. You are going to have to write this utility/script yourself.
  3. Use transport_maps to redirect mail for that always_bcc address to the transport you defined in master.cf
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.