-- |
-- Parse the SMTP packet stream.
parser :: B.ByteString -> P.Parser ()
parser code = do
   reply <- P.take 3
   if code /= reply
   then throw . ParseError $ "Expected SMTP reply code " ++ show code ++ ", but recieved SMTP reply code " ++ show reply ++ "."
   else anyChar >>= \ case
        ' ' -> return ()
        '-' -> manyTill anyChar endOfLine >> parser code
        _   -> throw $ ParseError "Unexpected character."

-- |
-- Define the TLS client parameters.
parser :: B.ByteString -> P.Parser ()
parser code = do
   reply <- P.take 3
   if code /= reply
   then throw . ParseError $ "Expected SMTP reply code " ++ show code ++ ", but recieved SMTP reply code " ++ show reply ++ "."
   else anyChar >>= \ case
        ' ' -> return ()
        '-' -> manyTill anyChar endOfLine >> parser code
        _   -> throw $ ParseError "Unexpected character."

-- |
-- Define the TLS client parameters.
parser code = do
   reply <- P.take 3
   if code /= reply
   then throw . ParseError $ "Expected SMTP reply code " ++ show code ++ ", but recieved SMTP reply code " ++ show reply ++ "."
   else anyChar >>= \ case
        ' ' -> return ()
        '-' -> manyTill anyChar endOfLine >> parser code
        _   -> throw $ ParseError "Unexpected character."

-- |
-- Define the TLS client parameters.