Passport IMAP is an authentication strategy for the Passport module. This module serves the purpose of authenticating a user using IMAP login credentials in Node.js application using the Passport authentication module.


npm install passport-imap


Configure Strategy

The imap authentication strategy authenticates users using imap login information. The strategy requires some options like imap host name, port and tls

passport.use(new ImapStrategy({host: '', port : 993, tls : true}));

Authenticate Requests

Use passport.authenticate(), specifying the ‘imap’ strategy, to authenticate requests.

For example, as route middleware in an Express application:'/login', passport.authenticate('imap', { failureRedirect: '/login' }),
  function(req, res) {


The MIT License

Are you looking for scalable web-applications developed on Node.JS? Contact us at moc.a1664715210rtnat1664715210ten@s1664715210elas1664715210 or by filling in the form at, we can certainly help you out with it.