imap-0.3.0.6: An efficient IMAP client library, with SSL and streaming

Copyright2016 Michal Kawalec
LicenseBSD-style (see the file LICENSE)
MaintainerMichal Kawalec <michal@monad.cat>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Network.IMAP

Description

Usage:

   import Network.Connection
   import Network.IMAP

   let tls = TLSSettingsSimple False False False
   let params = ConnectionParams "imap.gmail.com" 993 (Just tls) Nothing
   conn <- connectServer params
   simpleFormat $ login conn "mylogin" "mypass"

For more usage examples, please see the readme

Synopsis

Documentation

connectServer :: ConnectionParams -> Maybe IMAPSettings -> IO IMAPConnection Source #

Connects to the server and gives you a connection object that needs to be passed to any other command. You should only call it once for every connection you wish to create

sendCommand :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> ByteString -> m CommandResult Source #

An escape hatch, gives you the ability to send any command to the server, even one not implemented by this library

startTLS :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> TLSSettings -> m CommandResult Source #

Connected state commands

Upgrade a connection to a TLS connection from an insecure one. Accepts TLS settings you wish your connection to use

login :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult Source #

A simple authentication method, with user and password. Probably what's needed in 90% of cases.

authenticate :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> ByteString -> (IMAPConnection -> m ()) -> m () Source #

Authenticate with the server. During the authentication control is given to the library user and is returned to the library at the end of authentication

select :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #

Authenticated state commands

check :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult Source #

Selected state commands

fetch :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #

Fetch message body by message sequence id

uidFetch :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #

Fetch message body by message UID

fetchG :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #

A general fetch, you have to specify everything that goes after the FETCH keyword

uidFetchG :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #

A general fetch using UIDs

uidCopy :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult Source #

Copy message by message UID

simpleFormat :: MonadIO m => ListT m CommandResult -> m SimpleResult Source #

Return the untagged replies or an error message if the tagged reply is of type NO or BAD. Also return all untagged replies received if replies list contains a BYE response (when the server decided to cleanly disconnect)