Re: Using PHP with bounce-back emails

From: Date: Fri, 18 Oct 2002 05:13:54 +0000
Subject: Re: Using PHP with bounce-back emails
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120459@lists.php.net to get a copy of this message
In article <20021017182521.67047.qmail@web14510.mail.yahoo.com>, daren_cotter@yahoo.com says... > Perhaps this is more of a SendMail issue, but I wish > to use PHP to accomplish this... > > I use PHP / MySQL to email my mailing list on a daily > basis (100,000+ emails). I have a current way of > keeping track of inactive & active members, but it's > not very good...I'm actually afraid to remove inactive > members, because I don't want to remove legitimate > members. > > The solution cannot involve modifying my database, as > I do not want to edit thousands of lines of code. > > Instead, I wish to use the bounce-back messages from > mail servers. I.e., "Account Over Quota", "Invalid > Account", etc...I would develop a script that would > log this, and delete members accordingly. > > The question, is how to develop this in a PHP script. > All of the bounce back message currently are delivered > to httpd@host.mydomain.com. I currently have that user > aliased to /dev/null. > > Obviously, I could simply alias that account to a > valid email account, but then I have to manually sift > through thousands of emails (some of which are > warnings, in which case I would want to take no > action, some of which are Account over Quota, which I > also don't want the account deleted, etc). > > Instead, I want to "pass" this email + data to a PHP > script. The script would search through the text of > the email, find out why it was returned, and take any > necessary actions. > > I know how to code PHP scripts to run on command line. > What I need to know is: > > 1) How to alias the mail to a PHP script? > 2) How to not only alias this mail, but also pass off > the message as to why it was returned (usually > contained in an attachment). 1) You can pass an incoming mail to an application via the alias method in sendmail - simply set up an alias thus: httpd: "| /path/to your/script.php" and of course invoke newalias to install it. As for 2) I guess you will need to go peruse the RFCs to determine how attachments are represented, and work from there. Having said that, I should mention that this functionality is built into ezmlm/qmail, and even majordomo, which will work under sendmail, has some form of bounce control - not as sophisticated as ezmlm however. With both ezmlm and majordomo, you can use the info from the db to control membership if needs be. ezmlm can use mysql to store its subscription info. > Please help! > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > -- David Robley Temporary Kiwi! Quod subigo farinam

« previous php.general (#120459) next »