Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have configured postfix for my domain successfully. Now I want to add function as described in the following example:

If someone mails me at, one php script will fetch information of sender email inside mail details and also (defined in php script) add and store in some mysql database and automatically forward this msg to another postfix account like . I have little information that I need to config file in postfix and set some called aliases. I have configured postfix first time and I don't have deep knowledge of it..

What is this technique called ?

How can I make this possible?

share|improve this question

2 Answers 2

The simplest way to do something like that is to set up an alias that forwards a copy of the target user's mail to a program that munges it at leisure.

Be careful, at least here in Chile it is illegal to manipulate other's electronic mail in any way. Even if they agree (no, I didn't write the laws).

share|improve this answer
A common arrangement is to do this from .procmailrc. Procmail mainly adds a bit of a safety net and the ability to call arbitrary external programs just by editing a user file, so you don't have to much with the system's settings. –  tripleee Jan 24 '13 at 19:48

This can be done by specifying content filter in, see this:

share|improve this answer
Please do not post an answer that consists essentially of a link. Include the important points in your answer; leave the link for extra information or as a reference. –  Gilles Jan 23 '13 at 22:21

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.