Type Definitions
AppendResponseObject :Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
destination |
String |
full mailbox path where the message was uploaded to |
|
uidValidity |
BigInt |
<optional> |
mailbox |
uid |
Number |
<optional> |
UID of the uploaded message if server has |
seq |
Number |
<optional> |
sequence number of the uploaded message if path is currently selected mailbox |
CopyResponseObject :Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String |
path of source mailbox |
|
destination |
String |
path of destination mailbox |
|
uidValidity |
BigInt |
<optional> |
destination mailbox |
uidMap |
Map.<number, number> |
<optional> |
Map of UID values (if server has |
DownloadObject :Object
Properties:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
meta |
Object |
content metadata Properties
|
||||||||||||||||||||||||
content |
ReadableStream |
Streamed content |
FetchMessageObject :Object
Fetched message data
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
seq |
Number |
message sequence number. Always included in the response |
|
uid |
Number |
message UID number. Always included in the response |
|
source |
Buffer |
<optional> |
message source for the requested byte range |
modseq |
BigInt |
<optional> |
message Modseq number. Always included if the server supports CONDSTORE extension |
emailId |
String |
<optional> |
unique email ID. Always included if server supports |
threadid |
String |
<optional> |
unique thread ID. Only present if server supports |
labels |
Set.<string> |
<optional> |
a Set of labels. Only present if server supports |
size |
Number |
<optional> |
message size |
flags |
Set.<string> |
<optional> |
a set of message flags |
flagColor |
String |
<optional> |
flag color like "red", or "yellow". This value is derived from the |
envelope |
MessageEnvelopeObject |
<optional> |
message envelope |
bodyStructure |
MessageStructureObject |
<optional> |
message body structure |
internalDate |
Date |
<optional> |
message internal date |
bodyParts |
Map.<string, Buffer> |
<optional> |
a Map of message body parts where key is requested part identifier and value is a Buffer |
headers |
Buffer |
<optional> |
Requested header lines as Buffer |
FetchQueryObject :Object
Properties:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uid |
Boolean |
<optional> |
if |
||||||||||||
flags |
Boolean |
<optional> |
if |
||||||||||||
bodyStructure |
Boolean |
<optional> |
if |
||||||||||||
envelope |
Boolean |
<optional> |
if |
||||||||||||
internalDate |
Boolean |
<optional> |
if |
||||||||||||
size |
Boolean |
<optional> |
if |
||||||||||||
source |
boolean | Object |
<optional> |
if Properties
|
||||||||||||
threadId |
String |
<optional> |
if |
||||||||||||
labels |
Boolean |
<optional> |
if |
||||||||||||
headers |
boolean | Array.<string> |
<optional> |
if |
||||||||||||
bodyParts |
Array.<string> |
<optional> |
An array of BODYPART identifiers to include in the response |
IdInfoObject :Object
Client and server identification object, where key is one of RFC2971 defined data fields (but not limited to).
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String |
<optional> |
Name of the program |
version |
String |
<optional> |
Version number of the program |
os |
String |
<optional> |
Name of the operating system |
vendor |
String |
<optional> |
Vendor of the client/server |
'support-url' |
String |
<optional> |
URL to contact for support |
date |
Date |
<optional> |
Date program was released |
ListOptions :Object
Properties:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
statusQuery |
Object |
<optional> |
request status items for every listed entry Properties
|
||||||||||||||||||||||||||||
specialUseHints |
Object |
<optional> |
set specific paths as special use folders, this would override special use flags provided from the server Properties
|
ListResponse :Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String |
mailbox path (unicode string) |
|
pathAsListed |
String |
mailbox path as listed in the LIST/LSUB response |
|
name |
String |
mailbox name (last part of path after delimiter) |
|
delimiter |
String |
mailbox path delimiter, usually "." or "/" |
|
parent |
Array.<String> |
An array of parent folder names. All names are in unicode |
|
parentPath |
String |
Same as |
|
flags |
Set.<string> |
a set of flags for this mailbox |
|
specialUse |
String |
one of special-use flags (if applicable): "\All", "\Archive", "\Drafts", "\Flagged", "\Junk", "\Sent", "\Trash". Additionally INBOX has non-standard "\Inbox" flag set |
|
listed |
Boolean |
|
|
subscribed |
Boolean |
|
|
status |
StatusObject |
<optional> |
If |
ListTreeResponse :Object
Properties:
Name | Type | Description |
---|---|---|
root |
Boolean |
If |
path |
String |
mailbox path |
name |
String |
mailbox name (last part of path after delimiter) |
delimiter |
String |
mailbox path delimiter, usually "." or "/" |
flags |
Array.<String> |
list of flags for this mailbox |
specialUse |
String |
one of special-use flags (if applicable): "\All", "\Archive", "\Drafts", "\Flagged", "\Junk", "\Sent", "\Trash". Additionally INBOX has non-standard "\Inbox" flag set |
listed |
Boolean |
|
subscribed |
Boolean |
|
disabled |
Boolean |
If |
folders |
Array.<ListTreeResponse> |
An array of subfolders |
MailboxCreateResponse :Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String |
full mailbox path |
|
mailboxId |
String |
<optional> |
unique mailbox ID if server supports |
created |
Boolean |
If |
MailboxDeleteResponse :Object
Properties:
Name | Type | Description |
---|---|---|
path |
String |
full mailbox path that was deleted |
MailboxLockObject :Object
Properties:
Name | Type | Description |
---|---|---|
path |
String |
mailbox path |
release |
function |
Release current lock |
Example
let lock = await client.getMailboxLock('INBOX');
try {
// do something in the mailbox
} finally {
// use finally{} to make sure lock is released even if exception occurs
lock.release();
}
MailboxObject :Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String |
mailbox path |
|
delimiter |
String |
mailbox path delimiter, usually "." or "/" |
|
flags |
Set.<string> |
list of flags for this mailbox |
|
specialUse |
String |
<optional> |
one of special-use flags (if applicable): "\All", "\Archive", "\Drafts", "\Flagged", "\Junk", "\Sent", "\Trash". Additionally INBOX has non-standard "\Inbox" flag set |
listed |
Boolean |
|
|
subscribed |
Boolean |
|
|
permanentFlags |
Set.<string> |
A Set of flags available to use in this mailbox. If it is not set or includes special flag "\*" then any flag can be used. |
|
mailboxId |
String |
<optional> |
unique mailbox ID if server has |
highestModseq |
BigInt |
<optional> |
latest known modseq value if server has CONDSTORE or XYMHIGHESTMODSEQ enabled |
noModseq |
String |
<optional> |
if true then the server doesn't support the persistent storage of mod-sequences for the mailbox |
uidValidity |
BigInt |
Mailbox |
|
uidNext |
Number |
Next predicted UID |
|
exists |
Number |
Messages in this folder |
MailboxRenameResponse :Object
Properties:
Name | Type | Description |
---|---|---|
path |
String |
full mailbox path that was renamed |
newPath |
String |
new full mailbox path |
MessageAddressObject :Object
Parsed email address entry
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String |
<optional> |
name of the address object (unicode) |
address |
String |
<optional> |
email address |
MessageEnvelopeObject :Object
Parsed IMAP ENVELOPE object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
date |
Date |
<optional> |
header date |
subject |
String |
<optional> |
message subject (unicode) |
messageId |
String |
<optional> |
Message ID of the message |
inReplyTo |
String |
<optional> |
Message ID from In-Reply-To header |
from |
Array.<MessageAddressObject> |
<optional> |
Array of addresses from the From: header |
sender |
Array.<MessageAddressObject> |
<optional> |
Array of addresses from the Sender: header |
replyTo |
Array.<MessageAddressObject> |
<optional> |
Array of addresses from the Reply-To: header |
to |
Array.<MessageAddressObject> |
<optional> |
Array of addresses from the To: header |
cc |
Array.<MessageAddressObject> |
<optional> |
Array of addresses from the Cc: header |
bcc |
Array.<MessageAddressObject> |
<optional> |
Array of addresses from the Bcc: header |
MessageStructureObject :Object
Parsed IMAP BODYSTRUCTURE object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
part |
String |
Body part number. This value can be used to later fetch the contents of this part of the message |
|
type |
String |
Content-Type of this node |
|
parameters |
Object |
<optional> |
Additional parameters for Content-Type, eg "charset" |
id |
String |
<optional> |
Content-ID |
encoding |
String |
<optional> |
Transfer encoding |
size |
Number |
<optional> |
Expected size of the node |
envelope |
MessageEnvelopeObject |
<optional> |
message envelope of embedded RFC822 message |
disposition |
String |
<optional> |
Content disposition |
dispositionParameters |
Object |
<optional> |
Additional parameters for Content-Disposition |
childNodes |
Array.<MessageStructureObject> |
An array of child nodes if this is a multipart node. Not present for normal nodes |
QuotaResponse :Object
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
String | INBOX |
mailbox path this quota applies to |
|||||||||||||
storage |
Object |
<optional> |
Storage quota if provided by server Properties
|
|||||||||||||
messages |
Object |
<optional> |
Message count quota if provided by server Properties
|
SearchObject :Object
IMAP search query options. By default all conditions must match. In case of or
query term at least one condition must match.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
seq |
SequenceString |
<optional> |
message ordering sequence range |
answered |
Boolean |
<optional> |
Messages with (value is |
deleted |
Boolean |
<optional> |
Messages with (value is |
draft |
Boolean |
<optional> |
Messages with (value is |
flagged |
Boolean |
<optional> |
Messages with (value is |
seen |
Boolean |
<optional> |
Messages with (value is |
all |
Boolean |
<optional> |
If |
new |
Boolean |
<optional> |
If |
old |
Boolean |
<optional> |
If |
recent |
Boolean |
<optional> |
If |
from |
String |
<optional> |
Matches From: address field |
to |
String |
<optional> |
Matches To: address field |
cc |
String |
<optional> |
Matches Cc: address field |
bcc |
String |
<optional> |
Matches Bcc: address field |
body |
String |
<optional> |
Matches message body |
subject |
String |
<optional> |
Matches message subject |
larger |
Number |
<optional> |
Matches messages larger than value |
smaller |
Number |
<optional> |
Matches messages smaller than value |
uid |
SequenceString |
<optional> |
UID sequence range |
modseq |
BigInt |
<optional> |
Matches messages with modseq higher than value |
emailId |
String |
<optional> |
unique email ID. Only used if server supports |
threadId |
String |
<optional> |
unique thread ID. Only used if server supports |
before |
Date | string |
<optional> |
Matches messages received before date |
on |
Date | string |
<optional> |
Matches messages received on date (ignores time) |
since |
Date | string |
<optional> |
Matches messages received after date |
sentBefore |
Date | string |
<optional> |
Matches messages sent before date |
sentOn |
Date | string |
<optional> |
Matches messages sent on date (ignores time) |
sentSince |
Date | string |
<optional> |
Matches messages sent after date |
keyword |
String |
<optional> |
Matches messages that have the custom flag set |
unKeyword |
String |
<optional> |
Matches messages that do not have the custom flag set |
header |
Object.<string, (Boolean|String)> |
<optional> |
Matches messages with header key set if value is |
or |
Array.<SearchObject> |
<optional> |
An array of 2 or more |
SequenceString :String
Sequence range string. Separate different values with commas, number ranges with colons and use \* as the placeholder for the newest message in mailbox
Example
"1:*" // for all messages
"1,2,3" // for messages 1, 2 and 3
"1,2,4:6" // for messages 1,2,4,5,6
"*" // for the newest message
StatusObject :Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String |
full mailbox path that was checked |
|
messages |
Number |
<optional> |
Count of messages |
recent |
Number |
<optional> |
Count of messages with \Recent tag |
uidNext |
Number |
<optional> |
Predicted next UID |
uidValidity |
BigInt |
<optional> |
Mailbox |
unseen |
Number |
<optional> |
Count of unseen messages |
highestModseq |
BigInt |
<optional> |
Last known modseq value (if CONDSTORE extension is enabled) |