I think the question is how can you automatically remove bounced emails 
from a list you deploy with CF from a database.

While you can do this with CF, there are a couple of third-party products 
that have already done a lot of this logic for you and they are much more 
efficient than CFPOP (at least in CF4.5).

We use something called BroadcastHTML from www.mailworkz.com, which does 
require a little trial and error and still requires some manual 
intervention on a monthly basis, but is much faster and easier than 
anything we could have developed in CF4.5. It's not terribly expensive when 
you factor in the development time you'll save. I believe there are some 
free packages available for Linux or FreeBSD if you don't want to use a 
windows-based package.

If you absolutely HAVE to do it in CF, the easiest way I can think of would 
be to embed the record number from the database in the mail header with the 
<CFMAILPARAM> tag when you blast out the mailing, and then parse your 
returned mailbox for the custom mail header (something like "X_Record:") 
and the record number. Then of course, delete or flag that record as 
undeliverable. If you format the record numbers to a uniform length by 
adding leading 0's, you should be able to extract the number fairly easily.

However, some mail servers will return the original message as an 
attachment, so you'll have to convert all attachments as inline text or 
also parse the attachments in order for it to work on all of the messages. 
Even then it will require a lot of trial and error to account for all of 
the different implementations of bounceback messages (if only there were a 
standard for that!), so there will be some manual work to keep the list clean.

That's about as far as we had gotten when we came across BroadcastHTML and 
cut our losses on the CF development.

If anyone has a solution that really gets ALL undeliverables with no manual 
intervention, I would certainly be interested.

HTH

Mike


At 10/25/2001 05:04 PM, you wrote:
>I don't know what a database has to do with this, but if you just want to
>parse out <[EMAIL PROTECTED]> use a regular expression.
>
>
>On Thu, 25 Oct 2001, Michael Gribbin wrote:
>
> > Alex,
> >
> > Thanks, what you said makes sense to me now. I do send out the initial
> > emails, but since the returned emails are in the attachment, I can't get
> > anything from the original TO: or the original BODY: to show up in my
> > database.
> >
> > In fact, I think I am overlooking something here.
> >
> > Example: This is what the returning email server wrote in the body, as well
> > as including the original email as an attchment.
> >
> > ---------------------
> > The original message was received at Tue, 2 Oct 2001 03:18:29 -0700 (PDT)
> > from [209.221.166.109]
> >
> >    ----- The following addresses had permanent fatal errors -----
> > <[EMAIL PROTECTED]>
> >
> >    ----- Transcript of session follows -----
> > <[EMAIL PROTECTED]>...Deferred: Connection timed out with 
> resortsys.com.
> > Message could not be delivered for 5 days
> > Message will be deleted from queue
> > -----------------
> >
> > None of the above shows up in the database either.
> >
> > But when the same routine processes an email from the same returned batch
> > that included one sent from a porno site that has in the body:
> >
> > "Finally a nude celebrity site for people that hate celebrity sites!"
> >
> > That shows up in the database just fine. Go figure!!!
> >
> > So I'm wondering what there is about the body of the returned email that
> > keeps it from being inserted. Like I said, when I use the same QUERY and
> > show the body in HTML using #query.body#, it all show up just fine. I could
> > pinpoint the problem if none of them worked but original emails are fine,
> > returned emails, no.
> >
> > Michael Gribbin
> >
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Alex" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Thursday, October 25, 2001 12:37 PM
> > Subject: Re: returned emails
> >
> >
> > > "First time" means the very first time an email is sent. NOT the returns.
> > > Do you send the initial emails or just get returned emails?
> > >
> > >
> > > On Thu, 25 Oct 2001, Michael Gribbin wrote:
> > >
> > > > Alex,
> > > >
> > > > I guess i don't follow what you are saying. I have 500+ returned emails
> > each
> > > > with a different TO:email address. There is only one returned copy of
> > each
> > > > of them. I don't understand the "first time" and the "bounces". So 
> far I
> > > > haven't been able to get any of the TO:email address into my database.
> > (Of
> > > > course I haven't tried all 500+ yet, but will and see if any show up).
> > > >
> > > > Further explaination would be appreciated.
> > > >
> > > > Michael Gribbin
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Alex" <[EMAIL PROTECTED]>
> > > > To: "CF-Talk" <[EMAIL PROTECTED]>
> > > > Sent: Thursday, October 25, 2001 11:43 AM
> > > > Subject: Re: returned emails
> > > >
> > > >
> > > > > send the emails out with the email address in the body of the 
> text the
> > > > > FIRST time. Then on bounces grab the to email address from there
> > > > >
> > > > > On Thu, 25 Oct 2001, Michael Gribbin wrote:
> > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > I have an interesting problem I need help with. I have a client 
> that
> > > > sends
> > > > > > out around 5000 emails from a master list once a week. About 
> 500 per
> > > > session
> > > > > > are returned as undeliverable. I am writing a program to grab the
> > > > returned
> > > > > > email from the POP server, strip out the email addresses and 
> ftp the
> > > > > > resulting "bad" list to a different server for master list 
> cleaning.
> > > > > >
> > > > > > I don't have any problems with the CFPOP getting the emails, 
> nor the
> > > > CFFTP
> > > > > > putting the list where it belongs. My problem is that most of the
> > > > returned
> > > > > > emails have the original "TO: Email Address" in an attatchment. 
> When
> > I
> > > > view
> > > > > > these emails in my Outlook Express, the attatchment shows up as 
> part
> > of
> > > > the
> > > > > > message body. When I download them with CFPOP and view them as 
> HTML,
> > > > these
> > > > > > attatchments shows up as part of the message body. When I INSERT
> > them
> > > > into
> > > > > > an Access database using the same CFQUERY as the HTML display, and
> > the
> > > > same
> > > > > > #query.body#, the part of the message body that was the attatchment
> > > > won't
> > > > > > show up. Only the part of the message body that is not in the
> > > > attatchment is
> > > > > > there.
> > > > > >
> > > > > > Kind of defeats my intentions if I can't grab the original "TO:
> > Email
> > > > > > Address".
> > > > > >
> > > > > > Any help will be appreciated,
> > > > > >
> > > > > > Michael Gribbin
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to