node-red / node-red/node-red-nodes
node-red-node-email does not fallback to IPv4 if IPv6 connection fails
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 13h 57m
- Merged PRs (30d)
- 3
Description
Which node are you reporting and issue on?
node-red-node-email
What are the steps to reproduce?
Configure an outgoing email using smtp.gmail.com, but running on a IPv4 only network (for example, wifi router or computer without IPv6 enabled). Because smtp.gmail.com answers with a AAAA record first, and that's the one used, the connection will fail.
What happens?
Error: connect EHOSTUNREACH 2607:f8b0:4002:c0f::6d:465 - Local (:::49175)
at internalConnect (node:net:1110:16)
at defaultTriggerAsyncIdScope (node:internal/async_hooks:472:18)
at node:net:1356:9
at process.processTicksAndRejections (node:internal/process/task_queues:84:11)
What did you expect to happen?
After IPv6 connection fails, try the next DNS record which would be an IPv4 address, and then it would succeed. I know this is possible because I was able to patch nodemailer to skip AAAA records. It may however be not as simple to add an actual retry mechanism to the logic.
Environment
- Node-RED version:4.1.2
- Node.js version: 25.2.1
- npm version: n/a
- Platform/OS: mac/macos/brew
- Browser: firefox
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the node-red-node-email entry point and trace how the SMTP connection handles DNS results. Reproduce the problem with smtp.gmail.com on an IPv4-only network, then verify that an IPv6 connection failure proceeds to an IPv4 address and the email sends successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100