Handbook
Glossary
parse-email-header ( parsed-email strings -- parsed-email )
Vocabulary
imap
Inputs
parsed-email
an
object
strings
an
object
Outputs
parsed-email
an
object
Definition
USING:
accessors
ascii
assocs
combinators
kernel
sequences
splitting
splitting.monotonic
;
IN:
imap
:
parse-email-header
( parsed-email strings -- parsed-email )
[
nip
?first
"\t "
member?
]
monotonic-split
[
[
[
blank?
]
trim
]
map
" "
join
": "
split1
swap
>lower
]
map>alist
[
[
pick
headers>>
push-at
]
[
{
{
"date"
[
>>date
]
}
{
"to"
[
>>to
]
}
{
"from"
[
>>from
]
}
{
"subject"
[
>>subject
]
}
{
"return-path"
[
>>return-path
]
}
{
"cc"
[
>>to
]
}
{
"content-transfer-encoding"
[
>>content-transfer-encoding
]
}
{
"content-type"
[
>>content-type
]
}
[
2drop
]
}
case
]
2bi
]
assoc-each
;