Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on event "mail" with outlook only #915

Open
anasmebarki1996 opened this issue Mar 7, 2024 · 0 comments
Open

Issue on event "mail" with outlook only #915

anasmebarki1996 opened this issue Mar 7, 2024 · 0 comments

Comments

@anasmebarki1996
Copy link

anasmebarki1996 commented Mar 7, 2024

Issue Description
I am using the imap library to receive emails in my Node.js application. I have set up event handling for the 'mail' event to log a message whenever a new email is received:

imap.on('mail', async (numNewMsgs) => {
  console.log(`New email received: ${numNewMsgs}`);
});

However, I am encountering an issue where the application behaves differently when connected to Outlook's IMAP server compared to Gmail's IMAP server.

Problem

  • Outlook Account: When connected to Outlook's IMAP server, the application only receives the first email, and subsequent emails are not received.

  • Gmail Account: When connected to Gmail's IMAP server, the application receives emails consistently without any issues.

Configuration
Here is the configuration I am using for the IMAP connection:

this.imap = new Imap({
  user: process.env.OUTLOOK_ACCOUNT_EMAIL,
  password: process.env.OUTLOOK_ACCOUNT_PASSWORD,
  host: process.env.OUTLOOK_ACCOUNT_HOST,
  port: 993,
  tls: true,
  keepalive: {
    interval: 10000,
    idleInterval: 0,
    forceNoop: true,
  },
  tlsOptions: {
    rejectUnauthorized: false,
  },
});

Suggestions Needed
I would appreciate any suggestions or insights on why the application behaves differently with Outlook's IMAP server and how I can ensure consistent behavior across different email providers.

Thank you in advance for your help!

@anasmebarki1996 anasmebarki1996 changed the title Issue on mail with outlook only Issue on event "mail" with outlook only Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant