Skip to content

Handle SMTP timeout more gracefully #4

Description

@tinloaf

Hi,

first: thanks for building this. :)

I'm trying to use it (in the form of the docker container published to docker hub), and during my testing, my SMTP server was temporarily unavailable. This is what I see in my docker logs:

/app/node_modules/nodemailer/lib/smtp-connection/index.js:557
            err = new Error(message);
                  ^

Error: Connection timeout
    at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:557:19)
    at SMTPConnection._onError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:530:20)
    at Timeout.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:248:18)
    at listOnTimeout (node:internal/timers:594:17)
    at process.processTimers (node:internal/timers:529:7) {
  code: 'ETIMEDOUT',
  command: 'CONN'

}

After that, the whole application seems to be gone or hanging.

I think it would probably be good to have a couple of retries on a timeout, but at the least, the application should not crash, right?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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