Library
Module
Module type
Parameter
Class
Class type
IMAP queries and response data
Flags returned with a PERMANENTFLAG response code
type search_key =
| SEARCH_KEY_ALL
All messages in the mailbox.
*)| SEARCH_KEY_ANSWERED
Messages with the \Answered
flag set.
| SEARCH_KEY_BCC of string
Messages that contain the specified string in the envelope's BCC
field.
| SEARCH_KEY_BEFORE of day_month_year
Messages whose internal date (disregarding time and timezone) is earlier than the specified date.
*)| SEARCH_KEY_BODY of string
Messages that contain the specified string in the body of the message.
*)| SEARCH_KEY_CC of string
Messages that contain the specified string in the envelope's CC
field.
| SEARCH_KEY_DELETED
Messages with the \Deleted
flag set.
| SEARCH_KEY_FLAGGED
Messages with the \Flagged
flag set.
| SEARCH_KEY_FROM of string
Messages that contain the specified string in the envelope's FROM
field.
| SEARCH_KEY_KEYWORD of string
Messages with the specified keyword flag set.
*)| SEARCH_KEY_NEW
Messages that have the \Recent flag set but not the \Seen flag. This is functionally equivalent to `AND (`RECENT, `UNSEEN)
.
| SEARCH_KEY_OLD
Messages that do not have the \Recent
flag set. This is functionally equivalent to `NOT `RECENT
(as opposed to `NOT `NEW
).
| SEARCH_KEY_ON of day_month_year
Messages whose internal date (disregarding time and timezone) is within the specified date.
*)| SEARCH_KEY_RECENT
Messages that have the \Recent
flag set.
| SEARCH_KEY_SEEN
Messages that have the \Seen
flag set.
| SEARCH_KEY_SINCE of day_month_year
Messages whose internal date (disregarding time and timezone) is within or later than the specified date.
*)| SEARCH_KEY_SUBJECT of string
Messages that contain the specified string in the envelope's SUBJECT
field.
| SEARCH_KEY_TEXT of string
Messages that contain the specified string in the header or body of the message.
*)| SEARCH_KEY_TO of string
Messages that contain the specified string in the envelope's TO
field.
| SEARCH_KEY_UNANSWERED
Messages that do not have the \Answered
flag set.
| SEARCH_KEY_UNDELETED
Messages that do not have the \Deleted
flag set.
| SEARCH_KEY_UNFLAGGED
Messages that do not have the \Flagged
flag set.
| SEARCH_KEY_UNKEYWORD of string
Messages that do not have the specified keyword flag set.
*)| SEARCH_KEY_UNSEEN
Messages that do not have the \Seen
flag set.
| SEARCH_KEY_DRAFT
Messages with the \Draft
flag set.
| SEARCH_KEY_HEADER of string * string
Messages that have a header with the specified field-name (as defined in RFC-2822
) and that contains the specified string in the text of the header (what comes after the colon).
| SEARCH_KEY_LARGER of int
Messages with an RFC-2822
size larger than the specified number of bytes.
| SEARCH_KEY_NOT of search_key
Messages that do not match the specified search key.
*)| SEARCH_KEY_OR of search_key * search_key
Messages that match either search key.
*)| SEARCH_KEY_SENTBEFORE of day_month_year
Messages whose Date:
header (disregarding time and timezone) is earlier than the specified date.
| SEARCH_KEY_SENTON of day_month_year
Messages whose Date:
header (disregarding time and timezone) is within the specified date.
| SEARCH_KEY_SENTSINCE of day_month_year
Messages whose Date:
header (disregarding time and timezone) is within or later than the specified date.
| SEARCH_KEY_SMALLER of int
Messages with an RFC-2822
size smaller than the specified number of bytes.
| SEARCH_KEY_UID of ImapSet.t
Messages with unique identifiers corresponding to the specified unique identifier set.
*)| SEARCH_KEY_UNDRAFT
Messages that do not have the \Draft
flag set.
| SEARCH_KEY_INSET of ImapSet.t
Messages with message sequence numbers corresponding to the specified message sequence number set.
*)| SEARCH_KEY_AND of search_key * search_key
Messages that match both search keys.
*)| SEARCH_KEY_MODSEQ of (flag * search_key_modseq_entry_type) option * Uint64.t
| SEARCH_KEY_XGMRAW of string
Messages that satisfy Gmail search expression.
*)| SEARCH_KEY_XGMMSGID of Uint64.t
Message with given Gmail Message ID.
*)| SEARCH_KEY_XGMTHRID of Uint64.t
Messages with given Gmail Thread ID.
*)| SEARCH_KEY_XGMLABELS of string
Search keys
type section_spec =
| SECTION_SPEC_SECTION_MSGTEXT of section_msgtext
| SECTION_SPEC_SECTION_PART of section_part * section_text option
type section = section_spec option
type fetch_att =
| FETCH_ATT_ENVELOPE
MIME envelope information
*)| FETCH_ATT_INTERNALDATE
The message date kept by the server
*)| FETCH_ATT_RFC822_HEADER
The message header
*)| FETCH_ATT_RFC822_TEXT
The message text part
*)| FETCH_ATT_RFC822_SIZE
The size of the message content
*)| FETCH_ATT_RFC822
The message content (header and body)
*)| FETCH_ATT_BODY
The MIME description of the message
*)| FETCH_ATT_BODY_SECTION of section * (int * int) option
A MIME part content
*)| FETCH_ATT_BODY_PEEK_SECTION of section * (int * int) option
Like `BODYSECTION
, but does not set the `Seen
flag.
| FETCH_ATT_BODYSTRUCTURE
The MIME description of the message with additional information
*)| FETCH_ATT_UID
Unique identification number.
*)| FETCH_ATT_FLAGS
Message flags
*)| FETCH_ATT_EXTENSION of string
FETCH queries
MIME
type body_extension =
| BODY_EXTENSION_LIST of body_extension list
| BODY_EXTENSION_NUMBER of Uint32.t
| BODY_EXTENSION_NSTRING of string option
type body_ext_mpart = {
bd_parameter : body_fld_param;
bd_disposition : body_fld_dsp option;
bd_language : body_fld_lang option;
bd_loc : string option;
bd_extension_list : body_extension list;
}
type body_ext_1part = {
bd_md5 : string option;
bd_disposition : body_fld_dsp option;
bd_language : body_fld_lang option;
bd_loc : string option;
bd_extension_list : body_extension list;
}
type body_fields = {
bd_parameter : body_fld_param;
bd_id : string option;
bd_description : string option;
bd_encoding : body_fld_enc;
bd_size : int;
}
and body_type_1part_data =
| BODY_TYPE_1PART_BASIC of body_type_basic
| BODY_TYPE_1PART_MSG of body_type_msg
| BODY_TYPE_1PART_TEXT of body_type_text
and body_type_mpart = {
bd_list : body list;
bd_media_subtype : string;
bd_ext_mpart : body_ext_mpart;
}
type msg_att_body_section = {
sec_section : section;
sec_origin_octet : int option;
sec_body_part : string;
}
type msg_att_static =
| MSG_ATT_ENVELOPE of envelope
| MSG_ATT_INTERNALDATE of date_time
| MSG_ATT_RFC822 of string
| MSG_ATT_RFC822_HEADER of string
| MSG_ATT_RFC822_TEXT of string
| MSG_ATT_RFC822_SIZE of int
| MSG_ATT_BODY of body
| MSG_ATT_BODYSTRUCTURE of body
| MSG_ATT_BODY_SECTION of msg_att_body_section
| MSG_ATT_UID of Uint32.t
type msg_att_dynamic = flag_fetch list
type msg_att_item =
| MSG_ATT_ITEM_DYNAMIC of msg_att_dynamic
| MSG_ATT_ITEM_STATIC of msg_att_static
| MSG_ATT_ITEM_EXTENSION of msg_att_extension
type msg_att = msg_att_item list * Uint32.t
type status_att =
| STATUS_ATT_MESSAGES
Number of messages in the mailbox.
*)| STATUS_ATT_RECENT
Number of new messages in the mailbox.
*)| STATUS_ATT_UIDNEXT
The probable unique identification number of the next message to arrive.
*)| STATUS_ATT_UIDVALIDITY
The UID validity value of the mailbox.
*)| STATUS_ATT_UNSEEN
The number of unseen messages in the mailbox.
*)| STATUS_ATT_HIGHESTMODSEQ
The highest modification sequence of the mailbox. This requires support for the CONDSTORE extension.
*)STATUS queries: the different mailbox status attributes that can be fetched via Imap.status
.
type status_info =
| STATUS_ATT_MESSAGES of int
| STATUS_ATT_RECENT of int
| STATUS_ATT_UIDNEXT of Uint32.t
| STATUS_ATT_UIDVALIDITY of Uint32.t
| STATUS_ATT_UNSEEN of int
| STATUS_ATT_HIGHESTMODSEQ of Uint64.t
| STATUS_ATT_EXTENSION of status_info_extension
STATUS replies. See status_att
.
The type of mailbox single flags
The type of mailbox other flags
type mbx_list_flags = {
mbf_sflag : mbx_list_sflag option;
Mailbox single flag
*)mbf_oflags : mbx_list_oflag list;
}
Mailbox flag
List of "mailbox other flag"
type mailbox_list = {
mb_flag : mbx_list_flags;
List of mailbox flags
*)mb_delimiter : char option;
Delimiter of the mailbox path, '\000' if not present
*)mb_name : string;
}
List of mailbox flags
Name of the mailbox
type capability_data = capability list
List of capabilities
type resp_text_code =
| RESP_TEXT_CODE_ALERT
| RESP_TEXT_CODE_BADCHARSET of string list
| RESP_TEXT_CODE_CAPABILITY_DATA of capability_data
| RESP_TEXT_CODE_PARSE
| RESP_TEXT_CODE_PERMANENTFLAGS of flag_perm list
| RESP_TEXT_CODE_READ_ONLY
| RESP_TEXT_CODE_READ_WRITE
| RESP_TEXT_CODE_TRYCREATE
| RESP_TEXT_CODE_UIDNEXT of Uint32.t
| RESP_TEXT_CODE_UIDVALIDITY of Uint32.t
| RESP_TEXT_CODE_UNSEEN of Uint32.t
| RESP_TEXT_CODE_EXTENSION of resp_text_code_extension
| RESP_TEXT_CODE_OTHER of string * string option
| RESP_TEXT_CODE_NONE
response code, human readable text
Authentication condition responses
type resp_cond_auth = resp_cond_auth_type resp_cond
type resp_cond_bye = resp_text
BYE response
type response_fatal = resp_cond_bye
Condition state responses
type resp_cond_state = resp_cond_state_type resp_cond
Message information
type mailbox_data =
| MAILBOX_DATA_FLAGS of flag list
| MAILBOX_DATA_LIST of mailbox_list
| MAILBOX_DATA_LSUB of mailbox_list
| MAILBOX_DATA_SEARCH of Uint32.t list
| MAILBOX_DATA_STATUS of mailbox_data_status
| MAILBOX_DATA_EXISTS of int
| MAILBOX_DATA_RECENT of int
| MAILBOX_DATA_EXTENSION_DATA of mailbox_data_extension
Mailbox information
type response_data =
| RESP_DATA_COND_STATE of resp_cond_state
| RESP_DATA_COND_BYE of resp_cond_bye
| RESP_DATA_MAILBOX_DATA of mailbox_data
| RESP_DATA_MESSAGE_DATA of message_data
| RESP_DATA_CAPABILITY_DATA of capability_data
| RESP_DATA_EXTENSION_DATA of response_data_extension
Untagged response
Ending response
type response = {
rsp_cont_req_or_resp_data_list : cont_req_or_resp_data list;
rsp_resp_done : response_done;
}
type greeting =
| GREETING_RESP_COND_AUTH of resp_cond_auth
| GREETING_RESP_COND_BYE of resp_cond_bye
type _ extension_kind =
| RESPONSE_DATA : response_data_extension extension_kind
| RESP_TEXT_CODE : resp_text_code_extension extension_kind
| MAILBOX_DATA : mailbox_data_extension extension_kind
| FETCH_DATA : msg_att_extension extension_kind
| STATUS_ATT : status_info_extension extension_kind
type response_info = {
rsp_alert : string;
rsp_parse : string;
rsp_badcharset : string list;
rsp_trycreate : bool;
rsp_mailbox_list : mailbox_list list;
rsp_mailbox_lsub : mailbox_list list;
rsp_search_results : Uint32.t list;
rsp_status : mailbox_data_status;
rsp_expunged : Uint32.t list;
rsp_fetch_list : msg_att list;
rsp_extension_list : rsp_extension_data list;
rsp_other : string * string option;
}
type state = {
rsp_info : response_info;
sel_info : selection_info;
cap_info : capability list;
imap_response : string;
current_tag : string option;
next_tag : int;
out_buf : string list;
in_buf : Buffer.t;
in_pos : int;
}