Next: , Previous: guile-tools punify, Up: Miscellaneous Tools


13.32 guile-tools read-rfc822

Usage: read-rfc822 FILE

Read FILE, assumed to be in RFC822 format, and display it to stdout.
This is not very interesting, admittedly.

For Scheme programming, this module exports two procs:
  (read-rfc822 . args)               ; only first arg used
  (read-rfc822-silently port)

Parse FILE (a string) or PORT, respectively, and return a query proc that
takes a symbol COMP, and returns the message component COMP.  Supported
COMP (keyword or symbol) and the associated query return values are:
 #:from       -- #f (reserved for future mbox support)
 #:headers    -- alist of (HEADER-SYMBOL . "VALUE-STRING") pairs, in order
 #:body       -- rest of the mail message, a string
 #:body-lines -- rest of the mail message, as a list of lines
Any other query results in a "bad component" error.

TODO: Add "-m" option (mbox support).