Copyright | 2016 Michal Kawalec |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Michal Kawalec <michal@monad.cat> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
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
- connectServer :: ConnectionParams -> Maybe IMAPSettings -> IO IMAPConnection
- sendCommand :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> ByteString -> m CommandResult
- startTLS :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> TLSSettings -> m CommandResult
- capability :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult
- noop :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult
- logout :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult
- login :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult
- authenticate :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> ByteString -> (IMAPConnection -> m ()) -> m ()
- select :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- examine :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- create :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- delete :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- rename :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult
- subscribe :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- unsubscribe :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- list :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- lsub :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- status :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- append :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> ByteString -> Maybe [Flag] -> Maybe Text -> m CommandResult
- check :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult
- close :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult
- expunge :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult
- search :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- uidSearch :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- fetch :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- uidFetch :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- fetchG :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- uidFetchG :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult
- store :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> [Flag] -> m CommandResult
- uidStore :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> [Flag] -> m CommandResult
- copy :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult
- uidCopy :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult
- simpleFormat :: MonadIO m => ListT m CommandResult -> m SimpleResult
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
capability :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult Source #
noop :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult Source #
logout :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult Source #
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
examine :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
create :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
delete :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
rename :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult Source #
subscribe :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
unsubscribe :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
list :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
lsub :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
status :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
append :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> ByteString -> Maybe [Flag] -> Maybe Text -> m CommandResult Source #
check :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult Source #
Selected state commands
close :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult Source #
expunge :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> m CommandResult Source #
search :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
uidSearch :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> m CommandResult Source #
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
store :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> [Flag] -> m CommandResult Source #
uidStore :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> [Flag] -> m CommandResult Source #
copy :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult Source #
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)