ISPsystem.com Forums

ISPsystem.com Forums (http://forum.ispsystem.com//index.php)
-   General technical discussion (http://forum.ispsystem.com//forumdisplay.php?f=8)
-   -   Redirect all incoming email to script (http://forum.ispsystem.com//showthread.php?t=784)

Vito Botta 10-23-2009 02:16 AM

Redirect all incoming email to script
 
Hi all,

I have just installed the brilliant FOSS, Rails based ClockingIT for project management, and would like to be able to send comments to tasks by simply replying to the notification emails automatically sent by the application.
This is a feature supported by ClockingIT, but of course it also depends on the mail system's configuration.

How could I achieve this with ISPmanager / postfix?
I have tried the instructions here (see "Setting up Email Integration"), but those are based on FreeBSD with Sendmail, and do not seem to work on Postfix as installed by ISPmanager.

I have also tried directly from within ISPmanager to set cit: "|/path/to/cit/script/runner -e production 'Mailman.receive(STDIN.read)'" (where /path/to/cit is the root of the Rails application) as destination for all the incoming email for a domain, to no avail.

Any suggestions would be highly appreciated as am really looking forward to being able to update tasks via email.

Thanks in advance

Vito Botta 10-23-2009 02:55 AM

Solved.

Just in case somebody else needs this as well:

1) open /etc/mail/local-host-names and add a line with your domain name

2) open /etc/mail/virtusertable and add
@yourdomainname.com CIT

(you can use whatever vitual user name instead of CIT)

2) open /etc/aliases and add
cit: "| /website/root/script/runner -e production 'Mailman.receive(STDIN.read)'"

3) newaliases && postfix reload

4) make sure the x permissions on your script and the w permissions on the log sub folder (for Rails apps) are OK (I just chmod'ed 777 as am the only user etc)

This should also work to redirect all incoming email for a domain to PHP scripts or others, I think

jonetall 01-05-2010 01:12 PM

Hi!
Can somebody please help me how can I redirect an email to php script? I created one already and make my email redirect any of its incoming emails to my php script but it seems like the script is not reading the email and the email is bounced back to the sender.

tanya 01-11-2010 10:18 AM

Quote:

Originally Posted by jonetall (Post 3825)
Hi!
Can somebody please help me how can I redirect an email to php script? I created one already and make my email redirect any of its incoming emails to my php script but it seems like the script is not reading the email and the email is bounced back to the sender.

"| /website/root/script/runner -e production 'Mailman.receive(STDIN.read)'". Instead of "runner" you should write your php script.


All times are GMT +2. The time now is 04:11 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.