         helo get-ok
         dup from>> extract-email mail-from get-ok
         dup to>> [ extract-email rcpt-to get-ok ] each
+        dup cc>> [ extract-email rcpt-to get-ok ] each
+        dup bcc>> [ extract-email rcpt-to get-ok ] each
         data get-ok
         swap write-headers
         crlf

TUPLE: email
    { from string }
    { to array }
    { subject string }
    { body string } ;



: email>headers ( email -- hashtable )
    [
        {
            [ from>> "From" set ]
            [ to>> ", " join "To" set ]
            [ cc>> ", " join "Cc" set ]
            [ subject>> "Subject" set ]
        } cleave
        now timestamp>rfc822 "Date" set
        message-id "Message-Id" set
    ] { } make-assoc ;
