I need to store the emails received by postfix in mongodb ,

i red many sites and solution but i didn't find a way to do that.

I saw filters and master.cf but i don't know what is the right way to make it and how to do it.

So is there an event handlers or triggers in the postfix to do this.

BTW i'm not an administrator :)

Thanks in Advance

  • (facepalm) Why, gawd, why? Dec 2 '11 at 20:06

I'm not aware of a native way of doing this, so I wrote a LMTP daemon which can receive mail from Postfix and store it in mongodb:



If All you need is to store the mail into mongodb, you might want to write a small script with your favorite scripting tool and redirect the mails via /etc/aliases like this:

user: "|/path/to/script.sh"
user2: "|/path/to/script.sh --with params"

good luck :)


You might find this tutorial using Fluentd as a log collector between Postfix and MongoDB useful. The upshot of this approach is, if you decide to use other storage systems instead of/in addition to MongoDB, it would be a simple configuration file change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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