knadh / listmonk

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
https://listmonk.app
GNU Affero General Public License v3.0
14.53k stars 1.33k forks source link

Intermittent 'error sending message: broken pipe' #1992

Open henk23 opened 1 month ago

henk23 commented 1 month ago

Version:

Description of the bug and steps to reproduce: Since a few months ago we started getting a lot of these:

error sending message 'Confirm subscription': write tcp x.x.x.x:33690->x.x.x.x:587: write: broken pipe

It happens very rarely. I've never seen it during sending of a campaign, but it happens very often for the opt-in emails, so we have a lot of unconfirmed subscribers now, which starts to become a problem.

We were on Listmonk v2 and used the SMTP server of a really crappy mail hoster (Netcup). So we upgraded to v3 and switched to Gmail in hope of solving this. But sadly we keep seeing these errors in our logs.

Listmonk runs in docker on my virtual server, there is no other mail/smtp traffic coming from this IP, or anything fishy happening there.

Since it's Gmail I don't have access to SMTP logs, can only use the "Email log search" as a Workspace Admin, which does not include SMTP errors.

Is it possible that this has something to do with Listmonk? Some protocol violation, that leads to the server dropping the connection? Or maybe Listmonk is keeping the "pipe" open for too long and then for the next mail after 2 days, it is broken?

And the next question: Can Listmonk do anything about this? It seems like there is no retry happening, although I've set "5 retries" in settings --> SMTP. For my case, a retry after say 30 or 60 seconds would probably solve the problem.

Or if an automatic retry is not possible, somehow inform me that there was an error and give me the option to retry manually again?

MaximilianKohler commented 1 month ago

For my case, a retry after say 30 or 60 seconds would probably solve the problem.

Yeah, it would solve some other 4xx errors too. https://github.com/knadh/listmonk/issues/1717#issuecomment-2040780489