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.
parse-emails(() (input-port?) . opt-> . (listof email?))current-input-port as the stream of emails. Parse each email using parse-email and produce a list of all the parsed emails.parse-email(() (input-port?) . opt-> . email?)current-input-port as the stream of a single email. Behaviour is undefined for a stream of multiple emails. Parse the email into an Email.exn:malformed-emailFrom " between messages.