LSTSRV-L Archives

LISTSERV Site Administrators' Forum

LSTSRV-L

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Claude Etienne <[log in to unmask]>
Mon, 20 Mar 2006 15:34:36 -0500
text/plain (197 lines)
You should be able to write the bounces to a flat file and process the flat
file for all the bounces.  If you need the bounces to be in a table, then
simply create a table and insert the values into the table.  Below is how
you would configure your distribution job to write all bounces from a job to
a file called nolist-allbounces.changelog.  I also included a vbscript code
I wrote to parse that file and create an excel file but for you purposes,
you would open a db connection to the schema where you created the table to
hold all the bounces and insert the values as oppose to writing the results
to a file.  If you are familiar with vbscript and need a little guidance
with what I have below, I'd be more then happy to help you along.  If you're
not running Listserv on a Windows platform then hopefully you can follow the
logic and re-write the script using some shell scripting language.


//xxxx JOB ECHO=YES
DISTRIBUTE MAIL-MERGE DBMS=YES FROM=owner-nolist-allbounces@yourdomain
PW=xxxxxxx
//TO DD *
SELECT email FROM temp;
/*
//DATA DD *
Date: &*DATE;
From: "Your Name" <xxxx@yourdomain>
Reply-to: xxxx@yourdomain
Errors-to: xxxx@yourdomain
Subject: 2005 Job Fair
To: &*TO;




VBSCRIP

option explicit

Process_socbounces

Public Sub Process_socbounces()
Dim rs, sList, MyFileCounter, myDictionary
Dim myConn, myDate, Soc, msgbody, sbody
Dim sfso, file, sfile, MyFile, sEmail, sError, files, x
MyFileCounter = 0

Set myDictionary = CreateObject("Scripting.Dictionary")
Set sfso = CreateObject("Scripting.FileSystemObject")

myDictionary.add "ALLBOUNCES", "someemail@yourdomain"

for each x in myDictionary

 Soc = right(x,Len(x) - instr(x,"_"))

 MyFile = "C:\LISTSERV\MAIN\NOLIST-" & x & ".changelog"

 If sfso.FileExists(MyFile) = false then
  SendMail "listserv_process@yourdomain","postmaster@yourdomain","Errors
Processing " & Soc & " Bounce File", "The SPS file could not be
found.",1,"",1,0
      exit sub
 end if

 Set sfile = sfso.OpenTextFile(MyFile,1,false,0)
 sList = "BOUNCE_DATE EMAIL REASON FOR BOUNCE" & vbcrlf

 DO While not sfile.AtEndofLine = True
  file = sfile.ReadLine
      If Trim(file) <> "" then
   myDate = Mid(File, 5, 2) & "/" & Mid(File, 7, 2) & "/" & left(file, 4)
   If instr(File,"@") > 0 then
    MyFileCounter = MyFIleCounter + 1
    sEmail = Trim(Mid(File,instrrev(File," ",instr(File,"@")),
instr(instr(File,"@"),File, " ") - instrrev(File," ",instr(File,"@"))))
    sError = Trim(Mid(file, instr(instr(File,"@"),File, " ") + 1))
    sList = sList & myDate & chr(9) & sEmail & chr(9) & sError & vbcrlf
   End if
     End If
 Loop
msgbox 1
 If myFileCounter > 0 then
  CreateAfile sList, "C:\Files\SPS\" & x & "_" & Month(Date) & Day(Date) &
Year(Date) & ".xls"
  SendMail "listserv_process@yourdomain",myDictionary(x),Soc & " Bounce File
Process Complete " & Date & " (***TEST***)", sbody,1,"C:\Files\SPS\" & x &
"_" & Month(Date) & Day(Date) & Year(Date) & ".xls",1,0
 End if

 If Err.Number <> 0 Then
  SendMail "listserv_process@Yourdomain","postmaster@yourdomain","Errors
Processing " & Soc & " Bounce File", "ERROR: " & Err.Description,1,"",1,0
         Err.Clear
  Exit sub
 End if

 'createAfile "", MyFile
Next

set sfso = nothing
set MyFile = nothing
set file = nothing
end sub

'''''''''''''''''''SEND EMAIL
Sub
SendMail(strFrom,StrTo,StrSubject,StrBody,lngImportance,StrAttach,mailForm,b
odyForm)
         Dim myCDONTSMail

        Set myCDONTSMail = CreateObject("CDONTS.NewMail")
   MyCDONTSMail.MailFormat = mailForm
   MyCDOntsMail.BodyFormat = BodyForm
   If StrAttach <> "" then
   MyCDONTSMail.AttachFile(StrAttach)
   End IF
         myCDONTSMail.Send strFrom,strTo,strSubject,strBody,lngImportance
Set myCDONTSMail  = Nothing
End Sub
'###################################################
'
'Write output to Excel file
'
'###################################################
Sub CreateAfile(sText, sPath)
  Dim fso, MyFile
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set MyFile = fso.CreateTextFile(sPath, True)
  MyFile.WriteLine(sText)
  MyFile.Close
End Sub





----- Original Message ----- 
From: "Bruno Robichaud" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Monday, March 20, 2006 3:07 PM
Subject: Re: Bounced Email


> Well the way we use Listserv is with a mail-merge DBMS backend, so the
email
> list come from a DB table and I want the bounced to be in a DB table also
so
> I can clean my email list table from bounced Email. So are you telling me
> the only way I can re-direct the bounced email is with the header
> Return-path?
>
> -----Original Message-----
> From: LISTSERV site administrators' forum
> [mailto:[log in to unmask]] On Behalf Of Michael Loftis
> Sent: Monday, March 20, 2006 3:54 PM
> To: [log in to unmask]
> Subject: Re: Bounced Email
>
> --On March 20, 2006 3:05:06 PM -0400 Bruno Robichaud
> <[log in to unmask]> wrote:
>
> > -----Original Message-----
> > From: LISTSERV site administrators' forum
> > [mailto:[log in to unmask]] On Behalf Of Pete Weiss 2.0
> > Sent: Thursday, March 16, 2006 3:36 PM
> > To: [log in to unmask]
> > Subject: Re: Bounced Email
> >
> > What I want is to process all bounced email myself, I just want listserv
> > to send the bounced email to a particular mailbox so my system can
> > process the bounced email and update my list.
> >
> >
> >
> > I wonder if Bruno meant exclusive of LISTSERV(R) processing, or some
place
> > other than the default?
> >
> > If the second, then we can talk about this on lstown-L
> >
> > but in a nut-shell:
> >
> >  update list definition keywords
> >
> > ERRORS-TO= rfc822_addresses
> > AUTO-DELETE= NO
> >
>
> No this just updates the non-standard Errors-To: header which *NOONE*
> should be using but some incompetent programmers have made their software
> to use or prefer.  There are NO headers that should affect where error
> bounces go, but due to blatantly incompetent programmers who haven't read
a
> single RFC and who are unable to even write bounce processing anyway.
> Lotus/IBM/Domino Notes, this means you.
>
> As was mentioned in your before quoted reply, the return path is really
> only malleable from DISTRIBUTE jobs directly.  Why do you want to do your
> own bounce processing anyway?  You'll not do as good a job as ListServ.

ATOM RSS1 RSS2