1.0.7 • Published 3 years ago

@elnk/mfulib v1.0.7

Weekly downloads
82
License
MIT
Repository
bitbucket
Last release
3 years ago

mfulib1

A MFU library based on yapople.

yapople's design philosophy is simplicity. A lot of common tasks with you POP3 mailbox doesn't require knowledge of the eleven POP3 commands. You just want to retrieve some messages from your mailbox and that's all! mfulib1 will try to carry this forwward. So here is quick example how to do this with 'mfulib1'.

const Client = require('mfulib1').Client;
const client = new Client({
  host: 'mfuserv.earthlink.net',
  port:  501,
  username: 'username',
  password: 'password',
});
(async () => {
    await client.connect();
    await client.version;
    const blockList = await client.showList('BLOCK');
    blockLIst.forEach((entry) => {
      console.log(entry);
    });
    await client.disconnect();
})().catch(console.error);

Also this is a callback-driven and command-queued library instead of poplib So you can run methods in chain, don't think about already running command and get what you want in callback instead of putting somewhere event-listener functions to retrieve data. You can add connection options (optional) after callback.

Installation

npm install mfulib1

Tests

npm test

Constructor properties

When you create new Client object you should pass an object which describes connection properties.

  • host or hostname - string - MFU server hostname
  • port - number - port, usually 501
  • username - string - mailbox username
  • password - string - mailbox password
  • options - object - Optional configuration JSON object for socket creation. (see. TLS and NET)

Properties

  • connected - boolean - connect and login state

Methods

All the methods can be used both callback-style or promise-style if callback has been omitted.

connect(options, callback)

  • options - object
  • callback - function(err)

Connect to the mailserver using hostname and port. Then login into your mailbox using credentials properties username and password.

If options is defined, valuse from options will be used to connect for tls.connect or net.createConnection functions. Precedence goes to them instead of constructor options.

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago