0.1.1 • Published 1 year ago

imap-idle-keep-connection v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ImapIdleKeepConnection

use node-imap to connect to an imap server and handle all errors. Only emit mail event

Usage example:

const ImapIdleKeepConnection = require('imap-idle-keep-connection');

const imapConnection = new ImapIdleKeepConnection({
    user: MailUser,
    password: MailPassword,
    host: MailServer,
    port: MailServerPort,
    tls: true, //use TLS or not
    
    //optional log methods. By default errors are logged to console and nothing else:
    log: () => {},
    debug: () => {},
    error: () => {},
    
    // keepalive:
    interval: 10000, //default 10000ms - NOOPs are send & idleInterval is checked,
    idleInterval: 120000, //default 120000ms - interval at which IDLE command is resend
    forceNoop: false //default: false - force use of NOOP keepalice on servers also support IDLE
});

imapConnection.on('mail', (imap, numNewMessages) => {
    console.log('yay, got new mail!');
    //use imap, which is a node-imap instance to maybe receive mail.
});
0.1.1

1 year ago

0.1.0

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.3

1 year ago

0.0.1

1 year ago