I don't use Linux regularly, but do occasionally and I'm struggling with the email configuration that I'd like to get. I've run through a lot of information and tutorials on configuring Postfix and Courier but haven't found if it's possible to do a few things.

I'd like to store all received emails in a format which would be easy for me to 'post-process' the emails - my preferred choice would be MySQL. I should mention at this point that the server is not to be used in the regular sense of email, but rather for data collection.

The only machine that will need to access the mails is the server itself, to parse the headers and the body and harvest the necessary data.

Is it possible to configure Postfix (or an alternative?) like this, or possibly to execute a script upon receipt of an email, in which I would parse the email and add it to the database myself.

The basic purpose of the server is to receive emails which will then be stored and action taken depending on the contents of the body or the headers of the email.

I'd appreciate any help or nudges in the right direction here, I feel a bit like I'm chasing my tail as it seems that the docs I find assume I'm more au fait with Linux and mail server configuration.

2 Answers 2


you can try following link



you can configure procmail [ with postfix ], mails - instead of being delivered to user's folder will be delivered on standard input to script defined by you. this script in turn can parse messages and take action [or just store entire mails in database for processing later].

in regular postfix setup you add:

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

in /etc/aliases you add:

userName: "|/some/script"

and you run

postalias aliases

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.