Some questions about piping emails to a php script
All,
I'm trying to set up a system whereby emails sent to a certain address get piped to a PHP script for processi开发者_JAVA技巧ng.
Thanks to StackOverflow, I've found this on-point article:
http://www.evolt.org/incoming_mail_and_php
However, I've got a few simple/stupid questions about it:
First, in that article, you edit the /etc/aliases file and add an entry that looks like this:
script: "|/usr/bin/processingScript.php"
Does that mean that the email address you'd use is "script@[mydomain].com"?
Or, if I wanted the email address that I'd use to send emails for processing to be "processthis@mydomain.com", then the entry in the alias file would be:
processthis: "|/usr/bin/processingScript.php"
As an aside - should the entry actually have quotes around the script name, or is this just a typo in the article?
Next question... should there actually be a mail account on my server with this address? In other words, should I create a "script@mydomain.com" account? (This is a really dumb question, but I don't understand how aliases work).
Next question... I've read that when you edit the aliases file, you should run "newaliases" or "sendmail -bi" to tell sendmail to rebuild it's aliases database.
However, on my server (a MediaTemple DV server), there's no "newaliases" program, and "-bi" does not appear to be a valid parameter for sendmail. When I try it, I get this:
sendmail: usage: sendmail [ -t ] [ -fsender ] [ -Fname ] [ -bp ] [ -bs ] [ arg ... ]
(I realize that this might be a MediaTemple question, but maybe someone here has some insight...)
Many thanks in advance!
Cheers, Matt Stuehler
Short answer: yes. Long answer: "[mydomain].com" can be any of the domains the MTA is responsible for handling.
I do not recall ever using quotes in my pipe aliases.
There is no need to have a real account with the same name as an alias.
It might not actually be sendmail per se, but rather another MTA masquerading as sendmail.
精彩评论