| Email General questions, webmail, mailing lists. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#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? |
|
|
|
|
|
#2 (permalink) |
|
Registered User
Comfy Contributor
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. |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Comfy Contributor
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 |
|
|
|
|
|
#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) |
|
|
|
|
|
#5 (permalink) |
|
Registered User
Comfy Contributor
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 |
|
|
|
|
|
#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) |
|
|
|