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.

link|improve this question
feedback

migrated from stackoverflow.com Feb 5 at 0:20

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

1 Answer

up vote 0 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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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