A simple, configurable javascript interface exposing mailboxes and messages via IMAP.
npm install @cull/imapA minimal IMAP client interface exposing mailboxes, envelopes and messages.
This library is neither feature complete nor __Production Ready™__.
It is intended for short-lived connections and is generally useful as an introduction to IMAP and for quickly retrieving mailboxes, envelopes and message data in most cases.
The following is not currently implemented:
* Insecure (non-TLS) connections. _See Cleartext Considered Obsolete: Use of Transport Layer Security (TLS) for Email Submission and Access_
* Automatic UTF-7 encoding/decoding.
``sh`
npm install @cull/imap
`js
import Client from '@cull/imap';
let c = new Client({
host: 'mail.example.com',
user: 'user@example.com',
pass: 'password',
});
async () => {
try {
await c.connect();
let mailboxes = await c.mailboxes();
let envelopes = await c.envelopes('some/mailbox');
let messages = await c.messages('inbox', '1:3');
let headers = await c.headers('inbox');
} catch (error) {
console.error(error);
} finally {
await c.disconnect();
}
}();
`
Alternatively, study the tests.
makefile` codifies directives for building, testing, linting and other development oriented tasks.