postie-0.4.0.0: SMTP server library to receive emails from within Haskell programs.

Safe HaskellNone

Web.Postie.Settings

Synopsis

Documentation

data Settings Source

Settings to configure posties behaviour.

Constructors

Settings 

Fields

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 :: Maybe SessionID -> SomeException -> IO ()

Exception handler (default is defaultExceptionHandler)

settingsBeforeMainLoop :: IO ()

Action will be performed before main processing begins.

settingsOnOpen :: SessionID -> IO ()

Action will be performed when connection has been opened.

settingsOnClose :: SessionID -> IO ()

Action will be performed when connection has been closed.

settingsOnStartTLS :: SessionID -> IO ()

Action will be performend on STARTTLS command.

settingsOnHello :: SessionID -> ByteString -> IO HandlerResponse

Performed when client says hello

settingsOnMailFrom :: SessionID -> Address -> IO HandlerResponse

Performed when client starts mail transaction

settingsOnRecipient :: SessionID -> Address -> IO HandlerResponse

Performed when client adds recipient to mail transaction.

defaultSettings :: SettingsSource

Default settings for postie

data TLSSettings Source

Settings for TLS handling

Constructors

TLSSettings 

Fields

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.

Constructors

AllowStartTLS

Allows clients to use STARTTLS command

DemandStartTLS

Client needs to send STARTTLS command before issuing a mail transaction

ConnectWithTLS

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.