1

have a virtual alias setup in /etc/postfix/virtual that reads:

@mydomain.com mydomainincoming

I then have a pipe setup in /etc/aliases that reads:

mydomainincoming: "|/var/path_to_script/myscript.php"

whenever I send mail to more than one user such as addy1@mydomain.com and addy2@mydomain.com, my script is called twice and is passed the exact same email both times. For 3 users, the script is called 3X. How should I set this up so that my script only receives one email even if the email is sent to more than one user?

1 Answers1

1

Have the script check the Message-ID header and only process each ID once.

Ignacio Vazquez-Abrams
  • 45,019
  • 5
  • 78
  • 84
  • Yes. I thought of doing this. I would have to store the id in some persistent storage like a database. I suppose there is no way to configure the catch-all pipe to script without using a local alias ? – Richard Castle Feb 06 '11 at 01:48
  • Unfortunately no. The other way to process email is to retrieve it from a mailbox somewhere, but a pipe alias is the superior mechanism where available. – Ignacio Vazquez-Abrams Feb 06 '11 at 01:50
  • Okay. thanks a lot! I will implement a message-ID check. – Richard Castle Feb 06 '11 at 07:09