Skip to main content

Imap

Imap

Kind: global class

new Imap(config)

Await run() method before any action on this object

ParamTypeDescription
configImapConfigImap configuration

imap.run()

Run IMAP service You should await this method before any action on Imap object

Kind: instance method of Imap

imap.on(event, callback)

Use callback when event is emitted

Kind: instance method of Imap

ParamTypeDescription
event'newMail' / 'loadedMail' / 'deletedMail'Event to target
callback(mail) => voidCallback function to execute when event is emitted

imap.deleteMails(mailboxPath, toDelete) ⇒ boolean

Delete mails from uids or mail objects

Kind: instance method of Imap
Returns: boolean - true if mails are deleted

ParamTypeDescription
mailboxPathstringMailbox path where mails to delete are
toDeleteUidsListMails or uids of mails to delete

imap.seeMails(mailboxPath, toSee) ⇒ boolean

Mark mails as seen from uids or mail object

Kind: instance method of Imap
Returns: boolean - true if mails are marked seen

ParamTypeDescription
mailboxPathstringMailbox path where mails to see are
toSeeUidsListMails or uids of mails to see

imap.unseeMails(mailboxPath, toUnsee) ⇒ boolean

Mark mails as unseen from uids or mail object

Kind: instance method of Imap
Returns: boolean - true if mails are marked unseen

ParamTypeDescription
mailboxPathstringMailbox path where mails to unsee are
toUnseeUidsListMails or uids of mails to unsee

imap.getUnseenMails(mailboxPath) ⇒ Array.<Mail>

Get a list of unseen mails from a mailbox

Kind: instance method of Imap
Returns: Array.<Mail> - List of mails

ParamTypeDescription
mailboxPathstringPath to mailbox (or name)

imap.getSeenMails(mailboxPath) ⇒ Array.<Mail>

Get a list of seen mails from a mailbox

Kind: instance method of Imap
Returns: Array.<Mail> - List of mails

ParamTypeDescription
mailboxPathstringPath to mailbox (or name)

imap.getAllMails(mailboxPath) ⇒ Array.<Mail>

Get all the mails from a mailbox

Kind: instance method of Imap
Returns: Array.<Mail> - List of mails

ParamTypeDescription
mailboxPathstringPath to mailbox (or name)

imap.getMailboxes() ⇒ Map.<string, Mailbox>

Get list of mailboxes

Kind: instance method of Imap
Returns: Map.<string, Mailbox> - Map of mailboxes