joltra-imap-server

0.0.6 • Public • Published

joltra-imap-server

IMAP Server module for Nodejs

I needed an IMAP command parser and server which I could easily modify to integrate it in any storage system so I created this library in which every IMAP command can be easily overwritten.

Installation

npm install joltra-imap-server

Usage

var ImapServer = require('joltra-imap-server');
ImapServer.IMAPServer();

Command override example

//login function override
function ImapLogin(command, socket){
  if(command.args[0] == "user" && command.args[1]=="pass"){
    socket.write(command.tag + " OK Welcome overwritten " + command.args[0] + "\r\n");
    socket.IMAPState = ImapServer.IMAPState.Authenticated;
  }else{
    socket.write(command.tag + " NO Wrong user or password.\r\n");
  }
}
ImapServer.IMAPCommands.LOGIN.callback = ImapLogin;

Notes

  • Default port : 143

Readme

Keywords

none

Package Sidebar

Install

npm i joltra-imap-server

Weekly Downloads

0

Version

0.0.6

License

MIT

Last publish

Collaborators

  • socdream