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

If someone mails me at admin@kk.com, 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 rooot@kk.com . I have little information that I need to config main.cf 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?


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).

| improve this answer | |
  • 2
    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 master.cf, see this: http://blog.thecodingmachine.com/content/triggering-php-script-when-your-postfix-server-receives-mail

| improve this answer | |

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.