NYCPHP Meetup

NYPHP.org

[nycphp-talk] Text file to MySQL entries

Alberto dos Santos yournway at gmail.com
Fri Mar 10 13:49:59 EST 2006


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060310/c98e2a65/attachment.html>


More information about the talk mailing list