Stability | experimental |
---|---|
Maintainer | Ertugrul Soeylemez <es@ertes.de> |
This module implements the low level SMTP protocol implementation.
- data Extension
- type Mail a = StateT MailConfig (Iteratee ByteString IO) a
- data MailConfig = MailConfig {}
- runMail :: Int -> MailConfig -> Mail a -> IO a
- sendMail :: DnsMonad m => Int -> Domain -> Mail a -> m a
- sendMailDirect :: Int -> Address -> Mail a -> IO a
- waitForWelcome :: Mail ()
- sendHello :: ByteString -> Mail ()
- sendMailFrom :: ByteString -> Mail ()
- sendRcptTo :: ByteString -> Mail ()
- sendData :: Builder -> Mail ()
- sendReset :: Mail ()
- sendQuit :: Mail ()
- codeParser :: ByteString -> Parser [ByteString]
- mailPut :: Builder -> Mail ()
- mailPutList :: [ByteString] -> Mail ()
Types
type Mail a = StateT MailConfig (Iteratee ByteString IO) aSource
The Mail
monad transformer encapsulates an SMTP session.
data MailConfig Source
Mail session configuration.
Sessions
Running sessions
runMail :: Int -> MailConfig -> Mail a -> IO aSource
Run a Mail
computation with the given session timeout in
microseconds.
Chatting with the server
waitForWelcome :: Mail ()Source
Wait for 220 greeting.
sendHello :: ByteString -> Mail ()Source
Try *EHLO* with fallback to *HELO*.
sendMailFrom :: ByteString -> Mail ()Source
Send *MAIL FROM* command.
sendRcptTo :: ByteString -> Mail ()Source
Send *RCPT TO* command. By specification this command can be issued multiple times.
Utilities
Parsing
codeParser :: ByteString -> Parser [ByteString]Source
Read SMTP code.
Input/output
mailPutList :: [ByteString] -> Mail ()Source
Send a list of strings to the SMTP peer.