Parse a single email into a data structure representing the email.
Since this is on PLaneT, to download this is as simple as running the following program.
(require (planet "parse-email.ss" ("mburns" "parse-email" 1 0)))
(make-email (listof (cons Symbol String)) (listof (listof String)))
(define-struct email (headers messages))
Messages is a list of all the messages/attachments in the email. For normal emails without attachments, this is a list of one element.
A message is a list of strings, each string representing one line from the email.
(() (input-port?) . opt-> . (listof email?))
current-input-portas the stream of emails. Parse each email using
parse-emailand produce a list of all the parsed emails.
(() (input-port?) . opt-> . email?)
current-input-portas the stream of a single email. Behaviour is undefined for a stream of multiple emails. Parse the email into an Email.
From" between messages.
Mike Burns firstname.lastname@example.org