mbox
is a Go library to parse mbox files. It currently supports the mboxrd
format used for example for Google Mail exports.
The basic use case is to open a mailbox file and read its messages. The following code does not include error handling.
mbox, _ := mbox.Open(path, mbox.Mboxrd)
for {
msg, _ := mbox.Read()
if msg == nil {
break
}
fmt.Printf("%s\n", msg.Id)
}
mbox.Close()
The mbox
directory contains a tool to work with mbox files. Commands and
options can be displayed with mbox -h
.
If you have an idea or a question, email me at khaelin@gmail.com.