icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » Email » Forward email to a script

Email General questions, webmail, mailing lists.

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old July 26th, 2005, 8:57 PM   #1 (permalink)
Registered User
Fresh Surpasser
 
Joined in Jul 2004
3 posts
Gave thanks: 0
Thanked 0 times
Forward email to a script

I want to be able to forward an incoming email to a script, so that the script will be run when the email arrives (rather than having to be started by a web page request). I understand that Sendmail can send an incoming email to a script by using a .forward file (here's my source on that: http://www.evolt.org/article/Incomin..._PHP/18/27914/
) but I'm unable to make it work. Does anyone know how these .forward files work, or where they're supposed to be located? Also, will it forward anything that comes to my domain or how do I specify which email addresses it will forward?
bcasteel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 27th, 2005, 3:47 PM   #2 (permalink)
Registered User
Comfy Contributor
 
Einstein's Avatar
 
Joined in May 2004
Lives in Finland
Hosted on Centi
281 posts
Gave thanks: 0
Thanked 0 times
.forward files should be placed in users homedir (root) ... this mean /home/username

Don't know if it works for on surpasshosting ... but try first to put forwarding to another e-mail.

An other way to do it is with a cronjob that runs php script. PHP can easily access the mail with the following scripts: http://smilingsouls.net/Mail_IMAP/.
I have my own "public" mail script running that shows all e-mails (on the web) in a specific mailbox.
__________________

The secret to creativity is knowing how to hide your sources. - Alber Einstein
Centi: ykkosrasti.net
My sites on Pass38, reseller: kimslotte.net|mtb-o.net|perhekuvat.net|nettikuvat.net|tiedostotila.net
About me

Last edited by Einstein; July 27th, 2005 at 3:52 PM.
Einstein is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 27th, 2005, 4:44 PM   #3 (permalink)
Registered User
Comfy Contributor
 
Einstein's Avatar
 
Joined in May 2004
Lives in Finland
Hosted on Centi
281 posts
Gave thanks: 0
Thanked 0 times
After thinking a while about the sendmail solution ... it wont work on a Shared or Reseller plan (you need root). The .forward file is for your main account/e-mail, not a choosable e-mail.

But try the solution I suggested with the Mail_IMAP package.
__________________

The secret to creativity is knowing how to hide your sources. - Alber Einstein
Centi: ykkosrasti.net
My sites on Pass38, reseller: kimslotte.net|mtb-o.net|perhekuvat.net|nettikuvat.net|tiedostotila.net
About me
Einstein is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 27th, 2005, 5:11 PM   #4 (permalink)
Registered User
Comfy Contributor
 
Joined in Mar 2004
Lives in Detroit, MI
Hosted on sh66
101 posts
Gave thanks: 1
Thanked 0 times
Go to the "Add Forwarder" page in cPanel. Put in the desired name & domain as usual, but instead of putting an email address in the last field, put a vertical bar ("|") immediatly followed by the full path to the script (ie "/home/username/script.php").
__________________
farwestdetroit.org (sh66)
jhaskins is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 29th, 2005, 1:55 PM   #5 (permalink)
Registered User
Comfy Contributor
 
Einstein's Avatar
 
Joined in May 2004
Lives in Finland
Hosted on Centi
281 posts
Gave thanks: 0
Thanked 0 times
Or use "Add Filter" function ... frontend/x/mail/addblock.html. Does the using of a pipe works fine? Want to know before trying it myself.
__________________

The secret to creativity is knowing how to hide your sources. - Alber Einstein
Centi: ykkosrasti.net
My sites on Pass38, reseller: kimslotte.net|mtb-o.net|perhekuvat.net|nettikuvat.net|tiedostotila.net
About me
Einstein is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 29th, 2005, 6:23 PM   #6 (permalink)
Registered User
Comfy Contributor
 
Joined in Mar 2004
Lives in Detroit, MI
Hosted on sh66
101 posts
Gave thanks: 1
Thanked 0 times
Although I don't currenly have anything that does it, I have piped emails to scripts in the past that way.

I've never done it using a filter, but I would think that would only work if you had a "catchall" account (otherwise the server would bounce the message because it couldn't find the account). I could be totally wrong on that last part, as I've never actually tested it. It's just speculation.
__________________
farwestdetroit.org (sh66)
jhaskins is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On