Click or drag to resize
MimeKit

MimeParserMboxMarker Property

Get the most recent mbox marker.

Namespace: MimeKit
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public string MboxMarker { get; }

Property Value

String
The mbox marker.

Implements

IMimeParserMboxMarker
Remarks
Gets the most recent mbox marker.
Example
C#
public static void ParseMbox (string fileName)
{
    // Load every message from a Unix mbox spool.
    using (var stream = fileName.OpenRead (fileName)) {
        var parser = new MimeParser (stream, MimeFormat.Mbox);

        while (!parser.IsEndOfStream) {
            MimeMessage message = parser.ParseMessage ();
            long mboxMarkerOffset = parser.MboxMarkerOffset;
            string mboxMarker = parser.MboxMarker;

            Console.WriteLine ($"MBOX marker found @ {mboxMarkerOffset}: {mboxMarker}");

            // TODO: Do something with the message.
        }
    }
}
See Also