Client library for imap
npm install --save @datafire/imap
let imap = require('@datafire/imap').create({
user: "",
password: "",
host: "",
port: "",
tls: ""
});
.then(data => {
console.log(data);
});
Interact with e-mail servers via the Internet Message Access Protocol
imap.buildMessage({}, context)
- input
object
- to
string
- from
string
- subject
string
- body
string
- to
- output
string
: RFC 2822 compatible message
imap.getBoxes({}, context)
- input
object
- nsPrefix
string
- nsPrefix
- output
array
- items
object
- id
string
- attribs
array
- items
string
- items
- delimiter
string
- children
array
- items Box
- id
- items
imap.addBox({
"box": ""
}, context)
- input
object
- box required
string
- box required
- output
string
imap.deleteBox({
"box": ""
}, context)
- input
object
- box required
string
- box required
- output
string
imap.renameBox({
"oldName": "",
"newName": ""
}, context)
- input
object
- oldName required
string
- newName required
string
- oldName required
- output
string
imap.boxStatus({}, context)
- input
object
- box
string
- box
- output
object
- id
string
- attribs
array
- items
string
- items
- delimiter
string
- children
array
- items Box
- id
imap.subscribe({}, context)
- input
object
- box
string
- box
- output
string
imap.unsubscribe({}, context)
- input
object
- box
string
- box
- output
string
imap.getSubscribedBoxes({}, context)
- input
object
- nsPrefix
string
- nsPrefix
- output
string
imap.append({
"message": ""
}, context)
- input
object
- box
string
- message required
string
: An RFC-822 compatible MIME message - flags
array
- items
string
- items
- date
string
- box
- output
string
imap.fetch({
"messages": []
}, context)
- input
object
- box
string
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs
- box
- output
array
- items
object
- body
string
- attributes
object
- date
string
- flags
array
- items
string
- items
- uid
integer
- date
- body
- items
imap.search({
"query": {}
}, context)
- input
object
- box
string
- query required
object
- bcc
string
- cc
string
- from
string
- to
string
- subject
string
- body
string
- text
string
- keyword
string
- header
object
- name
string
- value
string
- name
- before
string
- on
string
- since
string
- sentBefore
string
- sentOn
string
- sentSince
string
- flags
array
: A list of flags to search for- items
string
(values: ALL, ANSWERED, DELETED, DRAFT, FLAGGED, NEW, SEEN, RECENT, OLD, UNANSWERED, UNDELETED, UNDRAFT, UNFLAGGED, UNSEEN)
- items
- bcc
- box
- output
array
- items
object
- body
string
- attributes
object
- date
string
- flags
array
- items
string
- items
- uid
integer
- date
- body
- items
imap.copy({
"messages": [],
"destinationBox": ""
}, context)
- input
object
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs - box
string
- destinationBox required
string
- messages required
- output
string
imap.move({
"messages": [],
"destinationBox": ""
}, context)
- input
object
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs - box
string
- destinationBox required
string
- messages required
- output
string
imap.addFlags({
"messages": [],
"flags": []
}, context)
- input
object
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs - box
string
- flags required
array
- items
string
- items
- messages required
- output
string
imap.setFlags({
"messages": [],
"flags": []
}, context)
- input
object
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs - box
string
- flags required
array
- items
string
- items
- messages required
- output
string
imap.deleteFlags({
"messages": [],
"flags": []
}, context)
- input
object
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs - box
string
- flags required
array
- items
string
- items
- messages required
- output
string
imap.addKeywords({
"messages": [],
"keywords": []
}, context)
- input
object
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs - box
string
- keywords required
array
- items
string
- items
- messages required
- output
string
imap.setKeywords({
"messages": [],
"keywords": []
}, context)
- input
object
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs - box
string
- keywords required
array
- items
string
- items
- messages required
- output
string
imap.deleteKeywords({
"messages": [],
"keywords": []
}, context)
- input
object
- messages required
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs - box
string
- keywords required
array
- items
string
- items
- messages required
- output
string
- Box
object
- id
string
- attribs
array
- items
string
- items
- delimiter
string
- children
array
- items Box
- id
- messages
array
,string
: A message UID, a range of UIDs (e.g. "2504:2507"), or an array of UIDs and ranges- items
string
- items
- isSequence
boolean
: If true, treat the message IDs/ranges as indexes in the specified box, rather than as UIDs
- Message
object
- body
string
- attributes
object
- date
string
- flags
array
- items
string
- items
- uid
integer
- date
- body
- box
string
- query
object
- bcc
string
- cc
string
- from
string
- to
string
- subject
string
- body
string
- text
string
- keyword
string
- header
object
- name
string
- value
string
- name
- before
string
- on
string
- since
string
- sentBefore
string
- sentOn
string
- sentSince
string
- flags
array
: A list of flags to search for- items
string
(values: ALL, ANSWERED, DELETED, DRAFT, FLAGGED, NEW, SEEN, RECENT, OLD, UNANSWERED, UNDELETED, UNDRAFT, UNFLAGGED, UNSEEN)
- items
- bcc