 ! See http://factorcode.org/license.txt for BSD license.
 USING: namespaces io io.timeouts kernel logging io.sockets
 sequences combinators sequences.lib splitting assocs strings
-math.parser random system calendar io.encodings.ascii
+math.parser random system calendar io.encodings.ascii summary
 calendar.format accessors sets ;
 IN: smtp
 

: data ( -- )
    "DATA" command ;

: validate-message ( msg -- msg' )
    "." over member? [ "Message cannot contain . on a line by itself" throw ] when ;

: send-body ( body -- )
    string-lines


: get-ok ( -- ) receive-response check-response ;

ERROR: invalid-header-string string ;

: validate-header ( string -- string' )
    dup "\r\n" intersect empty?
    [ invalid-header-string ] unless ;

: write-header ( key value -- )
    swap
