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.
npm install joltra-imap-server
var ImapServer = require('joltra-imap-server');
ImapServer.IMAPServer();
//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;
- Default port : 143