Checkmate icon indicating copy to clipboard operation
Checkmate copied to clipboard

BE - Nodemailer too many login attempts

Open ajhollid opened this issue 1 year ago • 1 comments

If too many emails are sent Google SMTP server gives a too many login attempts error.

This should be resolvable by pooling SMTP connection:

    this.transporter = nodemailer.createTransport({
      pool: true,
      host: process.env.SYSTEM_EMAIL_HOST,
      port: process.env.SYSTEM_EMAIL_PORT,
      secure: true, // Use `true` for port 465, `false` for all other ports
      auth: {
        user: process.env.SYSTEM_EMAIL_ADDRESS,
        pass: process.env.SYSTEM_EMAIL_PASSWORD,
      },
    });

but this doesn't seem to be working.

I'm not certain whether this is an actual issue with connections or Google rate limiting us.

Might need to move to a different mail server.

ajhollid avatar Aug 14 '24 21:08 ajhollid

Hi @ajhollid,

I wanted to suggest that we could potentially resolve the issue by closing the transporter pool after use. This might help us manage connections more effectively and reduce the likelihood of hitting Google’s rate limits.

Let me know your thoughts.

sankettank66 avatar Oct 14 '24 17:10 sankettank66

For this issue, I assume Google SMTP is not the right choice as it can be rate limited easily. For a serious setup, SendGrid, Mailgun, Postmark or alike should be used. They allow higher email limits and better control over email queues. Hence I am inclined to close this issue unless you have another opinion @ajhollid

gorkem-bwl avatar Mar 05 '25 01:03 gorkem-bwl

Agreed, I think this can be closed

ajhollid avatar Mar 05 '25 03:03 ajhollid