|A pure SMTP client state machine.
|:: String||Domain name used in EHLO command
|-> [Message]||List of messges to send
|Construct a pure state machine for an SMTP client session. Caller must
handle I/O. The message body may use either "\n" or "\r\n" for an
|smtpOutQueue :: [String]||Step 1. Caller must output any lines queued up in this list. They do not
have end-of-line characters, so the caller must add "\r\n" on the
end (as required by RFC2821 - not just "\n").
|smtpReceive :: String -> SMTPState -> SMTPState||Step 2. When sends are completed, the caller should wait for a line from
the SMTP server, strip the "\n" end-of-line characters, and pass the
line to this function for processing.
|smtpSuccess :: Bool||Step 3. Check if this is True, which indicates that the SMTP session
has completed successfully and there is no more work to do.
|smtpFailure :: Maybe String||Step 4. Check if this is Just err, which indicates that a protocol error
has occurred, and that the caller must terminate the session.
|smtpStatuses :: [Maybe SmtpReply]||A list containing a failure status for each message that has been sent so far,
where each element corresponds to one in the list of messages.
If the SMTP session fails part-way through, this list is likely to be
shorter than the input messages list.
Nothing means success, and Just x is a failure status returned by
the SMTP server.
An SMTP reply is a three-digit return code plus some
waste of bandwidth called "comments". This is what the
list of strings is for; one string per line in the reply.
show will append an "\r\n" end-of-line marker to
each entry in that list, so that the resulting string is
ready to be sent back to the peer.
Here is an example:
*Rfc2821> print $ Reply (Code Success MailSystem 0)
["worked", "like", "a charm" ]
250 a charm
If the message is , you'll get a really helpful
|This data type repesents a parsed Internet Message as defined in
this RFC. It consists of an arbitrary number of header lines,
represented in the Field data type, and a message body, which may
|This data type represents any of the header fields defined in this
RFC. Each of the various instances contains with the return value
of the corresponding parser.
|A NameAddr is composed of an optional realname a mandatory
|Produced by Haddock version 2.6.0|