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'd like to setup a POP/SMTP proxy which logs all emails to a database. Nginx does support POP3 and SMTP but I didn't find any possibility to log the mails to a database.

Unfortunately the existing mail server (Postfix) can not be configured or changed in anyway. The server accepts direct connections from/to the internet. In addition there are different mail clients used (Outlook, Thunderbird, iOS Mail, ...).

Which proxy server is able to accomplish this?

share|improve this question
For this to be even close to answerable we'll need to know what mail server you ARE using (even if it is immutable), and whether or not it delivers/accepts mail directly to/from the internet or relies on an upstream mailer (possibly an anti-spam service). – sysadmin1138 May 3 '12 at 18:11
Sorry for the missing details. I corrected the question accordingly. – SecStone May 3 '12 at 19:07
up vote 1 down vote accepted

Your architecture does not lend itself to putting a system like this in place. Ideally the postfix install could be modified to fork incoming/outgoing mails to an archive handler. Since you can't do that, you're stuck with more hackish methods.

For incoming mail, you can change the MX record for your domain to be a second box you set up to grab, store, and forward mail to the postfix box.

For outgoing mail, it's a lot harder. You will have to create a new mailer that does the archiving you're looking for, which then forwards on to the postfix box. This will require touching all clients to change the SMTP server the use.

share|improve this answer
Thank you for your response. Could you suggest any specific software products which I could use? – SecStone May 3 '12 at 19:46
@SecStone We don't do product or service recommendations here (per the FAQ), I'm afraid. – sysadmin1138 May 3 '12 at 19:47
@sysadmin1139 Sorry, I wasn't aware of this rule. – SecStone May 3 '12 at 20:04

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.