node-red/node-red-nodes

Can't send emails using fresh install + `node-red-node-email` on Raspberry Pi/Debian

01tot10 opened this issue · 4 comments

Which node are you reporting an issue on?

node-red-node-email

What are the steps to reproduce?

  • Install fresh node-red instance on Raspberry Pi / Debian as instructed here.
  • Install node-red-node-email from the palette or CLI.
  • Add a minimal flow to send an email.
  • Try to send an email.

What happens?

The email node hangs with the text sending email for a long while, after which it fails displaying:

Error: queryA ETIMEOUT smtp.gmail.com

I tried the exact same flow with my older node-RED instance, and the email goes through.
Thus, I feel like the error shouldn't be about internet/router problems.
Also, my current node-RED instance can access the internet normally.

I'm using gmail to send the email, and I know how to set an application password.
Also, I can read emails from my inbox using my new instance, so the application password seems to work.

What do you expect to happen?

The email to be sent

Please tell us about your environment:

  • node-red-node-email: 2.1.0
  • Node-RED version: 3.1.3
  • node.js version: v18.19.0
  • npm version: 10.2.3
  • Platform/OS: Raspberry Pi 4, Debian 12 Bookworm
  • Browser: Firefox 121.0

The error message implies a DNS problem on that pi.

What happens if you run nsloopkup smtp.gmail.com or ping smtp.gmail.com from a shell in that pi?

Hey @hardillb!

Thanks for the quick reply. You're right ping smtp.gmail.com doesn't result in anything using the new instance, while the old one pings nicely. I'll investigate the cause and report back.

Wait, no, that was incorrect! The new instance also pings, but it just takes a while to get started.
Don't know if that is a symptom of something? Here are the ping results:

PING smtp.gmail.com(lq-in-x6c.1e100.net (2a00:1450:4010:c0d::6c)) 56 data bytes
64 bytes from lq-in-f108.1e100.net (2a00:1450:4010:c0d::6c): icmp_seq=1 ttl=57 time=14.6 ms
64 bytes from lq-in-f108.1e100.net (2a00:1450:4010:c0d::6c): icmp_seq=2 ttl=57 time=13.4 ms
...

Managed to fix it! Thanks @hardillb for pointing me to the right direction with the DNS problem.

This was basically an error on my side, related to the confusion brought up by Raspberry Pi OS Bookworm changing the way how network connections are managed (see, ex. here).

In my case, I had multiple DNS entries in my /etc/resolv.conf, out of which the first one was unresponsive. The unresponsive DNS entry was revealed by running nslookup www.google.com, as helpfully suggested earlier. Apparently, the unresponsive DNS entry was used by node-RED, and it never made it to the second one?

I fixed the problem by fiddling with my router settings, since the unresponsive DNS entry was originating from there.