29. March 2011 06:33
For those that are interested, a new ListNanny update has been posted to the build udpates page.
The update includes the following:
A new NDRPart.Hrefs() method.
This method will return a list of all web links found in the body of a bounce.
Exposed the CategorizeBounce( string key, NDRType newTypeClassification) method.
This new NDR method will allow the developer to change the classification of a bounce. If the developer doesn't agree with ListNanny's bounce definition, the developer can simply call this method to remap the internal classification routine.
Fixed a bug in the ProcessingEngine class where it was possible to duplicate a NDR
There was a bug in the ProcessingEngine routine, where it was possible for a previous NDR to be prepended to the current NDR. This was unlikely to happen, but possible.
I also pushed a new NDR defintion file, that contains new NDR updates. This can be downloaded from:
http://listnanny.net/ndr1.65.def.xml (Right-Click Save Target As...)
If anyone has any questions, feel free to contact me.
26. March 2011 01:34
One of the capabilities of ListNanny, is for it to be able to parse MBX (sometimes called MBox or Mailbox) files. It can parse and classify individual bounces found within those files.
However, another use, is to simply use ListNanny to convert the MBX file into it's individual emails.
Here is a short, but complete code example on how to do this.
//counter used for naming individual files
private int mbxCounter = 0;
private void ExtractMBX()
//mbx path (change to match your system)
string mbxPath = @"D:\temp\main.mbx";
//processing engine found in ListNanny
ProcessingEngine pe = new ProcessingEngine();
//wire up the OnBeforeParse file event
pe.BeforeParseFile += new BeforeParseFileEventHandler( OnBeforeFileParse );
pe.ProcessMBXFile( mbxPath );
private void OnBeforeFileParse( object sender, BeforeParseFileEventArgs e )
//in this event, we will extract the email, save it to a file
//email file path
string emailFile = @"d:\temp\MBXFiles\ExractedFile" + mbxCounter.ToString("00000") + ".eml";
//write out the file
string contents = e.Contents;
StreamWriter sw = new StreamWriter(emailFile);
sw.Write( contents );
//tell ListNanny to ignore any further processing
e.IgnoreFile = true;
e.Contents = string.Empty;
'counter used for naming individual files
Private mbxCounter As Integer = 0
Private Sub ExtractMBX()
'mbx path (change to match your system)
Dim mbxPath As String = "D:\temp\main.mbx"
'processing engine found in ListNanny
Dim pe As New ProcessingEngine()
'wire up the OnBeforeParse file event
AddHandler pe.BeforeParseFile, AddressOf OnBeforeFileParse
End Sub 'ExtractMBX
Private Sub OnBeforeFileParse(sender As Object, e As BeforeParseFileEventArgs)
'in this event, we will extract the email, save it to a file
'email file path
Dim emailFile As String = "d:\temp\MBXFiles\ExractedFile" + mbxCounter.ToString("00000") + ".eml"
'write out the file
Dim contents As String = e.Contents
Dim sw As New StreamWriter(emailFile)
'tell ListNanny to ignore any further processing
e.IgnoreFile = True
e.Contents = String.Empty
mbxCounter += 1
As always, if anyone has any questions, let me know through the Contact Us page. Thanks! Dave