: get-ok-and-total ( -- total )
stream [
readln dup "+OK" head? [
- " " split second string>number dup account (>>count)
+ " " split second string>number dup account count<<
] [ throw ] if
] with-stream* ;
: (list) ( -- )
stream [
"LIST" command
- readlns account (>>list)
+ readlns account list<<
] with-stream* ;
: (uidls) ( -- )
stream [
"UIDL" command
- readlns account (>>uidls)
+ readlns account uidls<<
] with-stream* ;
PRIVATE>
: capa ( -- array )
stream [
"CAPA" command
- readlns dup account (>>capa)
+ readlns dup account capa<<
] with-stream* ;
: count ( -- n )
"TOP " _ number>string append " "
append _ number>string append
command
- readlns dup raw (>>top)
+ readlns dup raw top<<
] with-stream* ;
: headers ( -- assoc )
: retrieve ( message# -- seq )
[ stream ] dip '[
"RETR " _ number>string append command
- readlns dup raw (>>content)
+ readlns dup raw content<<
] with-stream* ;
: delete ( message# -- )