Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type ErrorMessage = Text
- type CommandId = ByteString
- data ConnectionState
- isUndefinedState :: ConnectionState -> Bool
- isConnected :: ConnectionState -> Bool
- isDisconnected :: ConnectionState -> Bool
- data IMAPConnection = IMAPConnection {}
- data IMAPState = IMAPState {}
- type ParseResult = Either ErrorMessage CommandResult
- data ResponseRequest = ResponseRequest {}
- data IMAPSettings = IMAPSettings {}
- data EmailAddress = EmailAddress {
- emailLabel :: Maybe Text
- emailRoute :: Maybe Text
- emailUsername :: Maybe Text
- emailDomain :: Maybe Text
- data Flag
- isFOther :: Flag -> Bool
- isFAny :: Flag -> Bool
- isFRecent :: Flag -> Bool
- isFDraft :: Flag -> Bool
- isFDeleted :: Flag -> Bool
- isFFlagged :: Flag -> Bool
- isFAnswered :: Flag -> Bool
- isFSeen :: Flag -> Bool
- data Capability
- = CIMAP4
- | CUnselect
- | CIdle
- | CNamespace
- | CQuota
- | CId
- | CExperimental Text
- | CChildren
- | CUIDPlus
- | CCompress Text
- | CEnable
- | CMove
- | CCondstore
- | CEsearch
- | CUtf8 Text
- | CAuth Text
- | CListExtended
- | CListStatus
- | CAppendLimit Int
- | COther Text (Maybe Text)
- data TaggedResult = TaggedResult {}
- data ResultState
- data UntaggedResult
- = Flags [Flag]
- | Exists Integer
- | Expunge Integer
- | Bye
- | HighestModSeq Integer
- | Recent Integer
- | Messages Integer
- | Unseen Integer
- | PermanentFlags [Flag]
- | UID Integer
- | MessageId Integer
- | UIDNext Integer
- | UIDValidity Integer
- | OKResult Text
- | NOResult Text
- | BADResult Text
- | Capabilities [Capability]
- | ListR {
- flags :: [NameAttribute]
- hierarchyDelimiter :: Text
- inboxName :: Text
- | Fetch [UntaggedResult]
- | StatusR Text [UntaggedResult]
- | Search [Integer]
- | Envelope {
- eDate :: Maybe Text
- eSubject :: Maybe Text
- eFrom :: Maybe [EmailAddress]
- eSender :: Maybe [EmailAddress]
- eReplyTo :: Maybe [EmailAddress]
- eTo :: Maybe [EmailAddress]
- eCC :: Maybe [EmailAddress]
- eBCC :: Maybe [EmailAddress]
- eInReplyTo :: Maybe Text
- eMessageId :: Maybe Text
- | InternalDate Text
- | Size Integer
- | Unknown ByteString
- | Body ByteString
- | BodyStructure ByteString
- | Extension ByteString ExtensionPayload
- isFlags :: UntaggedResult -> Bool
- isExists :: UntaggedResult -> Bool
- isExpunge :: UntaggedResult -> Bool
- isBye :: UntaggedResult -> Bool
- isHighestModSeq :: UntaggedResult -> Bool
- isRecent :: UntaggedResult -> Bool
- isMessages :: UntaggedResult -> Bool
- isUnseen :: UntaggedResult -> Bool
- isPermanentFlags :: UntaggedResult -> Bool
- isUID :: UntaggedResult -> Bool
- isMessageId :: UntaggedResult -> Bool
- isUIDNext :: UntaggedResult -> Bool
- isUIDValidity :: UntaggedResult -> Bool
- isOKResult :: UntaggedResult -> Bool
- isNOResult :: UntaggedResult -> Bool
- isBADResult :: UntaggedResult -> Bool
- isCapabilities :: UntaggedResult -> Bool
- isListR :: UntaggedResult -> Bool
- isFetch :: UntaggedResult -> Bool
- isStatusR :: UntaggedResult -> Bool
- isSearch :: UntaggedResult -> Bool
- isEnvelope :: UntaggedResult -> Bool
- isInternalDate :: UntaggedResult -> Bool
- isSize :: UntaggedResult -> Bool
- isUnknown :: UntaggedResult -> Bool
- isBody :: UntaggedResult -> Bool
- isBodyStructure :: UntaggedResult -> Bool
- isExtension :: UntaggedResult -> Bool
- data ExtensionPayload
- = ExtInt Integer
- | ExtLabels [ByteString]
- data NameAttribute
- data CommandResult
- isTagged :: CommandResult -> Bool
- isUntagged :: CommandResult -> Bool
- type SimpleResult = Either ErrorMessage [UntaggedResult]
- class Monad m => Universe m where
- defaultImapSettings :: IMAPSettings
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
isConnected :: ConnectionState -> Bool Source #
isDisconnected :: ConnectionState -> Bool Source #
data IMAPConnection Source #
IMAPConnection | |
|
IMAPState | |
|
data ResponseRequest Source #
ResponseRequest | |
|
data IMAPSettings Source #
data EmailAddress Source #
EmailAddress | |
|
isFDeleted :: Flag -> Bool Source #
isFFlagged :: Flag -> Bool Source #
isFAnswered :: Flag -> Bool Source #
data Capability Source #
CIMAP4 | |
CUnselect | |
CIdle | |
CNamespace | |
CQuota | |
CId | |
CExperimental Text | |
CChildren | |
CUIDPlus | |
CCompress Text | |
CEnable | |
CMove | |
CCondstore | |
CEsearch | |
CUtf8 Text | |
CAuth Text | |
CListExtended | |
CListStatus | |
CAppendLimit Int | |
COther Text (Maybe Text) | First parameter is the name of a capability and the second can contain a value, if the capability is of the form `NAME=VALUE` |
data TaggedResult Source #
Always the last result of the command, contains it's metadata
TaggedResult | |
|
data ResultState Source #
Tagged results can be in on of these three states
data UntaggedResult Source #
Untagged replies are the actual data returned in response to the commands.
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 |
ListR | |
| |
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 |
isFlags :: UntaggedResult -> Bool Source #
isExists :: UntaggedResult -> Bool Source #
isExpunge :: UntaggedResult -> Bool Source #
isBye :: UntaggedResult -> Bool Source #
isHighestModSeq :: UntaggedResult -> Bool Source #
isRecent :: UntaggedResult -> Bool Source #
isMessages :: UntaggedResult -> Bool Source #
isUnseen :: UntaggedResult -> Bool Source #
isUID :: UntaggedResult -> Bool Source #
isMessageId :: UntaggedResult -> Bool Source #
isUIDNext :: UntaggedResult -> Bool Source #
isUIDValidity :: UntaggedResult -> Bool Source #
isOKResult :: UntaggedResult -> Bool Source #
isNOResult :: UntaggedResult -> Bool Source #
isBADResult :: UntaggedResult -> Bool Source #
isCapabilities :: UntaggedResult -> Bool Source #
isListR :: UntaggedResult -> Bool Source #
isFetch :: UntaggedResult -> Bool Source #
isStatusR :: UntaggedResult -> Bool Source #
isSearch :: UntaggedResult -> Bool Source #
isEnvelope :: UntaggedResult -> Bool Source #
isInternalDate :: UntaggedResult -> Bool Source #
isSize :: UntaggedResult -> Bool Source #
isUnknown :: UntaggedResult -> Bool Source #
isBody :: UntaggedResult -> Bool Source #
isBodyStructure :: UntaggedResult -> Bool Source #
isExtension :: UntaggedResult -> Bool Source #
data ExtensionPayload Source #
data NameAttribute Source #
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
isTagged :: CommandResult -> Bool Source #
isUntagged :: CommandResult -> Bool Source #
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
connectionPut' :: Connection -> ByteString -> m () Source #
connectionGetChunk'' :: Connection -> (ByteString -> (a, ByteString)) -> m a Source #