-- |
-- Receive an unencrypted.
recvSMTP :: Handle -> Int -> B.ByteString -> IO ()
recvSMTP hdl micros code =
  runResourceT $ source $$ sink code
  where source = forever $ liftIO chunk >>= yield
        chunk  = timeout micros $ append <$> hGetLine hdl
        append = flip (<>) "\n" . B.pack

-- |
-- Receive an encrypted message.
recvSMTP :: Handle -> Int -> B.ByteString -> IO ()
recvSMTP hdl micros code =
  runResourceT $ source $$ sink code
  where source = forever $ liftIO chunk >>= yield
        chunk  = timeout micros $ append <$> hGetLine hdl
        append = flip (<>) "\n" . B.pack

-- |
-- Receive an encrypted message.
recvSMTP hdl micros code =
  runResourceT $ source $$ sink code
  where source = forever $ liftIO chunk >>= yield
        chunk  = timeout micros $ append <$> hGetLine hdl
        append = flip (<>) "\n" . B.pack

-- |
-- Receive an encrypted message.