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

Safe HaskellNone
LanguageHaskell2010

Network.IMAP.Types

Synopsis

Documentation

type ErrorMessage = Text Source #

A type alias used for an error message

type CommandId = ByteString Source #

Each command sent to the server is identified by a random id. this alias helps noticing where this happens

data ConnectionState Source #

Connection with the server can be in one of these states

data IMAPConnection Source #

Constructors

IMAPConnection 

Fields

data IMAPState Source #

Constructors

IMAPState 

Fields

data ResponseRequest Source #

Constructors

ResponseRequest 

Fields

data Flag Source #

Instances

Eq Flag Source # 

Methods

(==) :: Flag -> Flag -> Bool #

(/=) :: Flag -> Flag -> Bool #

Ord Flag Source # 

Methods

compare :: Flag -> Flag -> Ordering #

(<) :: Flag -> Flag -> Bool #

(<=) :: Flag -> Flag -> Bool #

(>) :: Flag -> Flag -> Bool #

(>=) :: Flag -> Flag -> Bool #

max :: Flag -> Flag -> Flag #

min :: Flag -> Flag -> Flag #

Show Flag Source # 

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

data TaggedResult Source #

Always the last result of the command, contains it's metadata

Constructors

TaggedResult 

Fields

data ResultState Source #

Tagged results can be in on of these three states

Constructors

OK 
NO 
BAD 

data UntaggedResult Source #

Untagged replies are the actual data returned in response to the commands.

Constructors

Flags [Flag]

A list of flags a mailbox has

Exists Integer

How many messages exist in a mailbox

Expunge Integer

Sequence id of a deleted message

Bye

Returned by the server when it cleanly disconnects

HighestModSeq Integer 
Recent Integer

Number of recent messages

Messages Integer

Number of messages in a mailbox

Unseen Integer

Number of unseen messages

PermanentFlags [Flag] 
UID Integer

UID of a message

MessageId Integer

A sequence id of a message |UID that will be given to the next message added to this mailbox

UIDNext Integer 
UIDValidity Integer

A triple of mailbox name, it's UIDValidity value and message UID is always unique for a given message

OKResult Text

Result of an OK response

NOResult Text

Result of a NO response

BADResult Text

Result of a BAD response

Capabilities [Capability]

What server advertises that it supports |Response to the LIST command

ListR 

Fields

Fetch [UntaggedResult]

Fetch response, contains many responses |Status of a mailbox, will contain many different responses inside

StatusR Text [UntaggedResult] 
Search [Integer]

A list of message IDs or UIDs fullfilling the search criterions

Envelope

A parsed ENVELOPE reply, prefixed to avoid name clashes

InternalDate Text 
Size Integer

Message size

Unknown ByteString

An unsupported value

Body ByteString

Message body, or headers

BodyStructure ByteString

An unparsed bodystructure

Extension ByteString ExtensionPayload

A format extension

data CommandResult Source #

Command result consits of a sequence of untagged results followed by a single tagged result that specifies if the command overall succeeded. This is a sum type to bind those two types together

type SimpleResult = Either ErrorMessage [UntaggedResult] Source #

If you don't care about streaming you will get results in this simplified data type, in which the ErrorMessage comes from TaggedResult if it failed.

class Monad m => Universe m where Source #

Every function that communicates with the outside world should run in the Universe monad, which provides an ability to use mocks when testing

Minimal complete definition

connectionPut', connectionGetChunk''