A Go library to parse mbox files.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mbox
.gitignore
LICENSE
README.mkd
mbox.go
message.go
message_test.go

README.mkd

go-mbox

Introduction

mbox is a Go library to parse mbox files. It currently supports the mboxrd format used for example for Google Mail exports.

Library

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()

mbox command

The mbox directory contains a tool to work with mbox files. Commands and options can be displayed with mbox -h.

Contact

If you have an idea or a question, email me at khaelin@gmail.com.