This is a library of one function (with two front doors) that parse mboxrd
This is a library of one function (with two front doors) that parse mboxrd
files into lazy lists of messages.
> (mboxrd-parse path)
;; mboxrd-parse : path -> (lazy-listof (list/c bytes? (promise/c bytes?)))
;; given a path to an mbox file, return a lazy list of the messages in the
;; file. Each file is represented as a list containing a byte-string
;; representing the header and the promise of a byte-string representing
;; the body. These byte-strings can be appended to obtain the original
;; message except that every \n in the original is replaced by \r\n to
;; match the RFC 2822 format.
> (mboxrd-parse/port port)
;; mboxrd-parse/port : port -> (lazy-listof (list/c bytes? (delay/c bytes?))
;; NB: this procedure assumes that it's the only one reading the port. Bad
;; stuff will happen if its not; it doesn't leave the "From " of the next
;; message on the stream.
;; EFFECT: reads from stream, closes it when peek-char returns #<eof>
Additionally, you can use the utilities (e.g. "extract-header") in
"net/head.ss" to process the header.
Let me know of any bugs.
John Clements