Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP timeout failure #1842

Open
krair opened this issue Apr 25, 2024 · 9 comments
Open

SMTP timeout failure #1842

krair opened this issue Apr 25, 2024 · 9 comments

Comments

@krair
Copy link

krair commented Apr 25, 2024

Version:

  • listmonk: v3.0.0
  • OS: Podman via AlmaLinux 9

Description of the bug and steps to reproduce:
I suppose the is related to the other thread(s) on SMTP failure. I am also getting the I/O timeout error as described in #1492

I am using Mailjet as my smtp relay.

The initial setup (and test) of SMTP works just fine, the test email works great. However, subsequent emails (like a double opt-in) don't make it to the SMTP server and I get an error in the log:

2024/04/24 20:45:11 manager.go:513: error sending message 'Confirm subscription': dial tcp 104.199.96.85:465: i/o timeout

If I switch the port to 587 for example, the test email will go through fine, and subsequent messages will go through, but not for long. Switching back to port 465 will also work again for some time, but eventually I hit the same error.

@krair
Copy link
Author

krair commented Apr 25, 2024

I should add that I use the exact same SMTP server, with the exact same SMTP settings, on the same server, in an app in a different container, and that works without failing after a period of time.

@knadh
Copy link
Owner

knadh commented Apr 25, 2024

hm, this seems related to #1837 and similar issues in the past. The app's attempt to establish an outgoing TCP connection fails. This has to be in Docker/network/environment/firewall ... At his point, I'm at a loss ;(

@krair
Copy link
Author

krair commented Apr 25, 2024

I don't know if this helps, but if I setup the smtp with the correct settings, the test email goes through.

Next, I click save settings, app reloads, I am still able to successfully send the test email (without leaving the page).

However, if I leave the page (go to dashboard for example) and return to the smtp settings, the test email fails with the i/o timeout error.

If I then change a setting like TLS from STARTTLS to TLS/SSL, and back to STARTTLS (never clicking save or anything else) the test email goes through just fine. There appears to be a bug in here, but I don't know go/js enough to start digging.

@knadh
Copy link
Owner

knadh commented Apr 25, 2024

When you change any setting and save, listmonk does a full restart. So something's getting flushed/cleared which is why it works. Then whatever's blocking the connection kicks in and connections fail. I'm at a loss here as to what could be blocking the connections and how.

@krair
Copy link
Author

krair commented Apr 25, 2024

I think you misread what I said. When I change a setting BUT DON'T SAVE, it also works.

@knadh
Copy link
Owner

knadh commented Apr 25, 2024

That's just a coincidence. Changing the setting on the UI without hitting save has no effect on the backend. That's just a browser/UI thing.

@krair
Copy link
Author

krair commented Apr 25, 2024

I tried to create a screen recording to show, and its true I can't get it to reliably reproduce the timeout error every time.

I will try running listmonk as a standalone binary and see if the error still exists.

Thank you anyways for the great app!

@MaximilianKohler
Copy link
Contributor

If you're using docker it may be a firewall issue. See #1837 (comment).

Docker may be opening some ports after you make a change, and then your firewall blocks them again.

@krair
Copy link
Author

krair commented Apr 25, 2024

@MaximilianKohler Thanks for the feedback, but firewalld with podman does not have the same outgoing restrictions. As stated above, the issue is intermittent. I will also try increasing the number of retries, and the timeout/wait times to see if it will clear up the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants