NYCPHP Meetup

NYPHP.org

[nycphp-talk] Text file to MySQL entries

Colin Goldberg coling at macmicro.com
Sun Mar 12 18:34:24 EST 2006


I created a bounce handler for my product that was subsequently refined 
and extended by Chris Fortune that does all this. Take a look at Chris's 
contribution to phpclasses:
http://www.phpclasses.org/browse/package/2691.html

Colin Goldberg
** <http://www.plezecall.com/ease-savings/pc.pl?pc=zp7C>


Alberto dos Santos wrote:
> Hi all.
>
> Sorry for not knowing my file handling routines 101, but I'm somewhat 
> desperate at this stage, so here it goes.
>
> I have a mail server that sends 200 000 emails daily, no mistake 200K 
> with qmail-send, to a mailing list.
> Sometimes older users just add another email address and fail to erase 
> the old one so I need to comb through the mailbox regularly to find 
> which addresses  are bouncing so I can delete them.
> all messages have more or less the same configuration, and we have a 
> shell app that compiles the name of the email file and the header onto 
> a text file, something like this:
>
>  ./1141578003.21775.ns31756.ovh.net,S=41699
> Return-Path: <>
> Delivered-To: root at myserver
> Received: (qmail 20952 invoked for bounce); 5 Mar 2006 16:59:17 -0000
> Date: 5 Mar 2006 16:59:17 -0000
> From: MAILER-DAEMON at myserver
> To: root at myserver
> Subject: failure notice
>
> Hi. This is the qmail-send program at myserver.
> I'm afraid I wasn't able to deliver your message to the following 
> addresses.
> This is a permanent error; I've given up. Sorry it didn't work out.
>
> <the recipient>:
> IPADDRESS does not like recipient.
> Remote host said: 550 <the recipient> is not a valid mailbox
> Giving up on IPADDRESS
>
> --- Below this line is a copy of the message.
>
>
>
> Now, I need to extract the file name, the date, the recipient and the 
> error onto a database to check which addresses have bounced and why.
>
> Anybody has some ideas on how I can do that?
> I looked on the net and the php manual and found some disparate 
> tentatives but no solid solution when we are not using an xml file.
>
> TIA
> -- 
> Alberto dos Santos
> Consultor em TI
> IT Consultant
>
> http://www.yournway.com
> A internet à sua maneira.
> The Internet your own way.
> ------------------------------------------------------------------------
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> New York PHP Conference and Expo 2006
> http://www.nyphpcon.com
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>   




More information about the talk mailing list