Imap
Imap
Kind: global class
- Imap
- new Imap(config)
- .run()
- .on(event, callback)
- .deleteMails(mailboxPath, toDelete) ⇒
boolean
- .seeMails(mailboxPath, toSee) ⇒
boolean
- .unseeMails(mailboxPath, toUnsee) ⇒
boolean
- .getUnseenMails(mailboxPath) ⇒
Array.<Mail>
- .getSeenMails(mailboxPath) ⇒
Array.<Mail>
- .getAllMails(mailboxPath) ⇒
Array.<Mail>
- .getMailboxes() ⇒
Map.<string, Mailbox>
new Imap(config)
Await run() method before any action on this object
Param | Type | Description |
---|---|---|
config | ImapConfig | Imap 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
Param | Type | Description |
---|---|---|
event | 'newMail' / 'loadedMail' / 'deletedMail' | Event to target |
callback | (mail) => void | Callback 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
Param | Type | Description |
---|---|---|
mailboxPath | string | Mailbox path where mails to delete are |
toDelete | UidsList | Mails 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
Param | Type | Description |
---|---|---|
mailboxPath | string | Mailbox path where mails to see are |
toSee | UidsList | Mails 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
Param | Type | Description |
---|---|---|
mailboxPath | string | Mailbox path where mails to unsee are |
toUnsee | UidsList | Mails 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
Param | Type | Description |
---|---|---|
mailboxPath | string | Path 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
Param | Type | Description |
---|---|---|
mailboxPath | string | Path 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
Param | Type | Description |
---|---|---|
mailboxPath | string | Path 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