Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data SMTP a
- smtp :: SMTPParameters -> SMTP a -> IO (Either SMTPError a)
- command :: Command -> SMTP ()
- bytes :: ByteString -> SMTP ()
- expect :: ([ReplyLine] -> Maybe SMTPError) -> SMTP ()
- expectCode :: ReplyCode -> SMTP ()
- data SMTPContext
- smtpContext :: SMTP SMTPContext
- getSMTPServerHostName :: SMTPContext -> HostName
- getSMTPClientHostName :: SMTPContext -> HostName
- startTLS :: SMTP ()
- data SMTPError
Documentation
An SMTP client EDSL: it can do effects, things can go wrong, and it carries state.
smtp :: SMTPParameters -> SMTP a -> IO (Either SMTPError a) Source
Run an expression in the SMTP monad. Should be exception safe, but I am not confident in this.
bytes :: ByteString -> SMTP () Source
Send some bytes, with a crlf inserted at the end, without waiting for the reply.
expect :: ([ReplyLine] -> Maybe SMTPError) -> SMTP () Source
Pull a response from the server, passing it through a function which checks that it's an expected response. If the response doesn't parse as an SMTP response, we give an UnexpectedResponse.
expectCode :: ReplyCode -> SMTP () Source
Like expect, but you give only the ReplyCode that is expected. Any other reply code, or an unexpected reponse, is considered a failure.
data SMTPContext Source
Description of the state which an SMTP term needs in order to be evaluated.
smtpContext :: SMTP SMTPContext Source
Grab the SMTPContext.
Description of an error in the SMTP monad evaluation.