SMTP email stopped working 10 days ago (curl works; server doesn't have SMTPS)

Hi All,

I’ve had my site running for a few years without issue now. All of a sudden, SMTP simply stopped working. (I made no config changes on host or in the container).

I’m using SMTP (not SMTPS). I entered the discourse container and tested that I could send mails using curl:

curl smtp://mail.example.com --mail-from myself@example.com --mail-rcpt receiver@example.com --upload-file email.txt

However Discourse doesn’t send any email and the logs simply say

Net::ReadTimeout with #<Socket:(closed)>

Postfix logs on the host say:

connect from unknown[172.17.0.5]
lost connection after CONNECT from unknown[172.17.0.5]
disconnect from unknown[172.17.0.5] commands=0/0

Does anyone have any idea what could have changed?

Thanks in advance.

GI

PS: Sorry the first version of this post got truncated by accident and only half the message posted. I just edited it.

Hi All,

I chased the problem down. Turns out the host is now imposing a 7 second delay on all incoming mail (even from containers). Discourse times out by default in 5 seconds.
I increased it to 10 seconds in containers/app.yml:

DISCOURSE_SMTP_OPEN_TIMEOUT: 10
DISCOURSE_SMTP_READ_TIMEOUT: 10

It works now… but does anyone know how to get rid of the postfix delay on the host? I’ve been searching through the config files but cant find anything…

GI

If you’re using postscreen, see postscreen_greet_wait and postscreen_greet_action.

If not, this may be due to DNS timing out on a reverse lookup of the connecting IP.

2 Likes

Ha! Thank you so much! This was exactly the problem.

I just added static IP addresses (with dummy host names) for all IP addresses docker will typically assign (172.17.0.2 through 10). So if my container comes up with a different IP, hopefully it won’t stall on the nslookup.

I wonder if there’s a way for docker to resolve IP addresses of alll containers…

Thanks again

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.