Skip to content

No need to poll imap server #2

@mscdex

Description

@mscdex

It's inefficient to continually reconnect just to check for new messages.

Instead, you should just connect once. Open your mailbox, check if there's new messages and if so, retrieve them. After that it's just a matter of listening for the 'mail' event. The callback for this event receives a number of new messages that arrived in your currently opened mailbox.

Also, you may want to upgrade to the latest version of node-imap too, there have been bugfixes and other things since the version this module explicitly requires.

BTW, it's good to see another module doing something cool with imap :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions