0

I am currently using Postfix to pipe incoming email form our support email address to our WHMCS install to the support department. This has been working great for sometime. Problem is now we have a live chat widget, and when someone sends an offline message it goes to the sales email but it's from Zopim:

From: Zopim «noreply@zopim.com»

What I would like to do is filter in Postfix that if an incoming email to the sales address is from that email to send it to another script instead of WHMCS, a PHP script we have written to scrape the email and change sender to the actual sender that Zopim received from on the live chat widget:

From: Visitor xxxxxxx <useremail@hotmail.com>

URL: http://www.domain.com/

Lorim Ipsum

----
Zopim
http://www.zopim.com

We are currently doing the piping in the Aliases file /etc/aliases:

support:  "| /usr/bin/php -q /var/www/pipe/pipe.php"
abuse:  "| /usr/bin/php -q /var/www/pipe/pipe.php"
sales: "|/usr/bin/php -q /var/www/pipe/pipe.php"
jfreak53
  • 188
  • 1
  • 3
  • 25

1 Answers1

3

Instead of piping email directly into your script, pipe it into procmail first. Procmail can look at the headers and route it accordingly.

toppledwagon
  • 4,215
  • 24
  • 15