Skip to content

Timed out while authenticating with server 5-10% of times #933

@victornikitin

Description

@victornikitin

Sometimes (5-10% of times) I get error "Timed out while authenticating with server" after .connect().

Code

      this.imap.once('ready', () => {
        console.log('ready')
      });
      this.imap.once('error', err => {
        console.log('error')
      });
      this.imap.once('end', () => {
        console.log('end')
      });
      this.imap.once('close', () => {
        console.log('close')
      });
      this.imap.connect();

Log:

[connection] Connected to host
<= '* OK IMAP4 ready'
=> 'A0 CAPABILITY'
<= '* CAPABILITY IMAP4rev1 UIDPLUS IDLE LITERAL+ QUOTA AUTH=PLAIN'
<= 'A0 OK completed'
=> 'A1 LOGIN "myloginhere" "mypasswordhere"'
[connection] Closed

Config

    this.imap = new Imap({
      user: credentials.login,
      password: credentials.password,
      host: credentials.connectionHost,
      port: credentials.connectionPort,
      tls: true,
      tlsOptions: {
        rejectUnauthorized: false,
      },
      keepalive: false,
      connTimeout: 30000,
      authTimeout: 15000,
      debug: console.log
    });

Version: 0.8.19

After couple of seconds another connection try can be ok.

What can be wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions