Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th January 2010, 01:03
elcore2010 elcore2010 is offline
Junior Member
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 5 Times in 5 Posts
Default How to exec a php script when receives an email

Hello,

How can i configure an account to parse each ermail received with a php script?

Thank you!
Reply With Quote
The Following User Says Thank You to elcore2010 For This Useful Post:
feeninuoumn (17th April 2014)
Sponsored Links
  #2  
Old 20th January 2010, 10:21
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,044
Thanks: 269
Thanked 154 Times in 133 Posts
Default

I'm doing this on one of my sites email's (on ISPconfig 2)

You will need to add the following in /etc/aliases
web96_info: "|/var/www/web96/web/script.php"
After this run newaliases to re-create the aliases db.

Now all email going to web96_info will be "piped" to /var/www/web96/web/script.php

More info here: http://www.evolt.org/article/Incomin...d_PHP/18/27914
Reply With Quote
  #3  
Old 20th January 2010, 10:34
elcore2010 elcore2010 is offline
Junior Member
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 5 Times in 5 Posts
Default

thank you, but web96_info is the user, what happens if we had two emails web96_info into 2 domains?
Reply With Quote
The Following User Says Thank You to elcore2010 For This Useful Post:
feeninuoumn (5th April 2014)
  #4  
Old 20th January 2010, 11:45
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,044
Thanks: 269
Thanked 154 Times in 133 Posts
Default

Quote:
Originally Posted by elcore2010 View Post
thank you, but web96_info is the user, what happens if we had two emails web96_info into 2 domains?
You will need to set web96_info to catch all emails, and let the "script.php" handel the rest
Reply With Quote
  #5  
Old 20th January 2010, 16:16
elcore2010 elcore2010 is offline
Junior Member
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 5 Times in 5 Posts
Default

so, if i had 2 email addresses in the server such: support@service.com and support@hardjob.com one alias such as support will handle theses 2 adresses??

could we get only ONE of thies email??
Reply With Quote
The Following User Says Thank You to elcore2010 For This Useful Post:
feeninuoumn (24th September 2014)
  #6  
Old 20th January 2010, 16:22
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,044
Thanks: 269
Thanked 154 Times in 133 Posts
Default

Sorry.. My misstake.
It will only work for one domain.
So if you need it for two you will need to set it up for both domains.

web96_support: "|/var/www/web96/web/script.php"
web97_support: "|/var/www/web96/web/script.php"

web96_support is for support@service.com and web97_support is for domain support@hardjob.com (you will need to change the web96 and web97 to your own number)

You can point both to the same script.php
Reply With Quote
  #7  
Old 20th January 2010, 17:11
elcore2010 elcore2010 is offline
Junior Member
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 5 Times in 5 Posts
Default

OK, I understand, so webX is the internal ID of ISPCONFIG fort each domain...

I'm doing it but i have errors:

email to parse: support@hardjob.com
the email accoutn is not created in ispconfig

in /etc/aliases I have added:
web4_support: "|/var/www/clients/client0/web1/web/cli/index.php"

web4 because i see in /var/www/clients/client1:
hardjob.com -> /var/www/clients/client1/web4/

but when i send an email to support@hardjob.com it returns it and i see in /var/log/mailog: Recipient address rejected: User unknown in virtual mailbox table

PD: hardjob.com is not my domain
Reply With Quote
The Following User Says Thank You to elcore2010 For This Useful Post:
feeninuoumn (10th October 2014)
  #8  
Old 20th January 2010, 17:40
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,044
Thanks: 269
Thanked 154 Times in 133 Posts
Default

did you run the command newaliases, and did you setup an account for hardjob.com to CatchAll ?
Reply With Quote
  #9  
Old 20th January 2010, 17:57
elcore2010 elcore2010 is offline
Junior Member
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 5 Times in 5 Posts
Default

yes, i have run newaliases to recreate them.

i have not catchall, iu have created now, but it doesn't work, the email is redirected to other email address but the pipe doesn't work...
Reply With Quote
The Following User Says Thank You to elcore2010 For This Useful Post:
feeninuoumn (17th April 2014)
  #10  
Old 20th January 2010, 20:30
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,044
Thanks: 269
Thanked 154 Times in 133 Posts
 
Default

It could be a permission problem!

I have this running on a ISPconfig 2 server (on: ).
Tomorrow I will test all this on my ISPconfig3 server.

I'll report back as soon as I know more.
Reply With Quote
The Following User Says Thank You to edge For This Useful Post:
feeninuoumn (24th September 2014)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 17:54
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 10:29
network issues now it says "401 The web site is blocked by administrator" Check General 3 26th February 2008 15:22
Slightly Confused (DNS & Server Help) JohnnyBGoode Installation/Configuration 26 14th August 2007 10:54
VirtualHosts marra87 General 9 12th September 2006 05:09


All times are GMT +2. The time now is 13:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.