postie- A library to receive emails from within Haskell programs.

Safe HaskellNone




data Settings Source

Settings to configure posties behaviour.




settingsPort :: PortID

Port postie will run on.

settingsTimeout :: Int

Timeout for connections in seconds

settingsMaxDataSize :: Int

Maximal size of incoming mail data

settingsHost :: Maybe HostName

Hostname which is shown in posties greeting.

settingsTLS :: Maybe TLSSettings

TLS settings if you wish to secure connections.

settingsOnException :: SomeException -> IO ()

Exception handler (default is defaultExceptionHandler)

settingsOnOpen :: IO ()

Action will be performed when connection has been opened.

settingsOnClose :: IO ()

Action will be performed when connection has been closed.

settingsBeforeMainLoop :: IO ()

Action will be performed before main processing begins.

settingsOnStartTLS :: IO ()

Action will be performend on STARTTLS command.

settingsOnHello :: ByteString -> IO HandlerResponse

Performed when client says hello

settingsOnMailFrom :: Address -> IO HandlerResponse

Performed when client starts mail transaction

settingsOnRecipient :: Address -> IO HandlerResponse

Performed when client adds recipient to mail transaction.

defaultSettings :: SettingsSource

Default settings for postie

data TLSSettings Source

Settings for TLS handling




certFile :: FilePath

Path to certificate file

keyFile :: FilePath

Path to private key file belonging to certificate

security :: StartTLSPolicy

Connection security mode, default is DemandStartTLS

tlsLogging :: Logging

Logging for TLS

tlsAllowedVersions :: [Version]

Supported TLS versions

tlsCiphers :: [Cipher]

Supported ciphers

data StartTLSPolicy Source

Connection security policy, either via STARTTLS command or on connection initiation.



Allows clients to use STARTTLS command


Client needs to send STARTTLS command before issuing a mail transaction


Negotiates a TSL context on connection startup.

tlsSettings :: FilePath -> FilePath -> TLSSettingsSource

Convenience function for creation of TLSSettings taking certificate and key file paths as parameters.