ismtp-1.0.2: Fast, incremental ESMTP sessions

Stabilityexperimental
MaintainerErtugrul Soeylemez <es@ertes.de>

Network.Smtp.Protocol

Contents

Description

This module implements the low level SMTP protocol implementation.

Synopsis

Types

data Extension Source

SMTP service extension.

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.

sendMail :: DnsMonad m => Int -> Domain -> Mail a -> m aSource

Send mail via MX.

sendMailDirect :: Int -> Address -> Mail a -> IO aSource

Send mail directly to a host.

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.

sendData :: Builder -> Mail ()Source

Send *DATA* command followed by the actual mail content.

sendReset :: Mail ()Source

Send *RSET* command to abort the current SMTP transaction.

sendQuit :: Mail ()Source

Send *QUIT* command to finish the SMTP session.

Utilities

Parsing

Input/output

mailPut :: Builder -> Mail ()Source

Send a command to the SMTP peer.

mailPutList :: [ByteString] -> Mail ()Source

Send a list of strings to the SMTP peer.