postmaster-0.1: Postmaster ESMTP ServerContentsIndex
Network.Postmaster.Main
PortabilityHaskell 2-pre
Stabilityprovisional
Maintainersimons@cryp.to
Contents
Speaking ESMTP
Running Smtpd Computations
ESMTP Network Daemon
Logging
Description
Postmaster's IO driver for System.IO.Driver and general initialization functions.
Synopsis
smtpdHandler :: WriteHandle -> GlobalEnv -> BlockHandler SmtpdState
smtpd :: Buffer -> Smtpd ([SmtpReply], Buffer)
handleDialog :: String -> Smtpd SmtpReply
runSmtpd' :: Logger -> Smtpd a -> GlobalEnv -> SmtpdState -> IO (a, SmtpdState)
runSmtpd :: Smtpd a -> GlobalEnv -> SmtpdState -> IO (a, SmtpdState)
withGlobalEnv :: HostName -> Resolver -> EventT -> (GlobalEnv -> IO a) -> IO a
smtpdServer :: Capacity -> GlobalEnv -> SocketHandler
smtpdMain :: Capacity -> GlobalEnv -> ReadHandle -> WriteHandle -> SmtpdState -> IO SmtpdState
main' :: Capacity -> PortID -> EventT -> IO ()
main :: IO ()
type Logger = LogMsg -> IO ()
withLogger :: Logger -> Smtpd a -> GlobalEnv -> StateT SmtpdState IO a
syslogger :: Logger
Speaking ESMTP
smtpdHandler :: WriteHandle -> GlobalEnv -> BlockHandler SmtpdState
This function ties it all together to build a BlockHandler for System.IO.Driver.
smtpd :: Buffer -> Smtpd ([SmtpReply], Buffer)
The unified interface to dialog and data section. This function relies on the fact that pipelining ends with DATA commands: dialog and payload must not come in a single buffer. See http://www.faqs.org/rfcs/rfc2920.html section 3.1.
handleDialog :: String -> Smtpd SmtpReply
Running Smtpd Computations
runSmtpd' :: Logger -> Smtpd a -> GlobalEnv -> SmtpdState -> IO (a, SmtpdState)
Run the given Smtpd computation and write the logging output via the given Logger. Use withGlobalEnv to create the global environment and emptyEnv to initialize the SmtpdState.
runSmtpd :: Smtpd a -> GlobalEnv -> SmtpdState -> IO (a, SmtpdState)
Convenience wrapper for runSmtpd' with Logger hard-coded to syslogger.
withGlobalEnv
::
=> HostNamemyHeloName
-> Resolver
-> EventT
-> GlobalEnv -> IO a
-> IO a
Run the given computation with an initialized global environment for Smtpd. The environment is destroyed when this function returns.
ESMTP Network Daemon
smtpdServer :: Capacity -> GlobalEnv -> SocketHandler
smtpdMain :: Capacity -> GlobalEnv -> ReadHandle -> WriteHandle -> SmtpdState -> IO SmtpdState
main' :: Capacity -> PortID -> EventT -> IO ()
main :: IO ()
Logging
type Logger = LogMsg -> IO ()
withLogger :: Logger -> Smtpd a -> GlobalEnv -> StateT SmtpdState IO a
Bind the logging back-end to demote Smtpd to an ordinary StateT computation.
syslogger :: Logger
Our default logging back-end.
Produced by Haddock version 2.1.0