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.46k stars 1.32k forks source link

Opt-In E-Mails are not sent from subscription form #1837

Closed fussel132 closed 3 weeks ago

fussel132 commented 4 months ago

Version:

Description of the bug and steps to reproduce: So our listmonk operates behind traefik reverse proxy. Everything works fine for a while now however I've noticed that under certain circumstances the opt-in mails fail to send. This only happens when a new subscriber registers itself via the online form, not if you send the opt-in message from within the subscriber management page. The log entry in such a case looks like this:

2024/04/22 15:33:38 error sending message 'Abonnement bestätigen': write tcp 172.20.0.3:44348-> xx.xx.xx.xx:587: write: connection reset by peer

I've noticed, the origin IP for this tcp connection appears to be the internal Docker Network IP not the actual public server IP. Is that a bug? Or where is this specific IP address set? This IP address should be determined by the root url right? As it only seems to works when I manually start the process, this issue is rather inconvenient for new subscribers. However, this might also be an issue with the firewall and/or the reverse proxy, so just a possible bug.

Thanks for any advice!

fussel132

MaximilianKohler commented 4 months ago

What firewall are you using? I had a problem with CSF Firewall and docker, and I solved it with a script: https://github.com/knadh/listmonk/issues/1608#issuecomment-1832640667

knadh commented 4 months ago

Hi @fussel132. The root URL is used purely for rendering URLs in HTML pages. It has nothing to do with SMTP.

listmonk simply opens a TCP connection to the target SMTP via whatever environment it is in. The behaviour depends entirely on the network configuration (Docker, system firewall etc.)

fussel132 commented 4 months ago

@MaximilianKohler We have a UniFi Dream Machine forwarding port 80 and 443 to the traefik proxy which redirects to listmonk's Docker container.

@knadh I just wonder what's the difference between me actively sending the opt in request from the dashboard and the user registering itself using the form. I have no clue how I should fix that particular issue because my guess was an issue with listmonk using the wrong source IP...

Thx!

knadh commented 4 months ago

That must be random, I think.

listmonk doesn’t pick an IP or a network interface. It simply relies on the default network interface and the IP bound to it on the system (Docker environment here). It has no control.

fussel132 commented 4 months ago

Hm makes sense, but why is listmonk not retrying to send the message if the first attempt fails? I've set the resend attempts within the SMTP settings to 10 however after one "connection reset by peer" it is not retrying to send, shouldn't that happen?

knadh commented 4 months ago

The error you're seeing is after the retries have been exhausted (which are done silently).

MaximilianKohler commented 4 months ago

Is there any delay between retries?

fussel132 commented 4 months ago

Seeing how quickly those 10 retries fail I'd say no... EDIT: Is listmonk even retrying to send the mail? Because the setting is related to a campaign it might not affect other cases where a mail is being sent (e.g. the confirmation mail as in my case...)

github-actions[bot] commented 4 weeks ago

This issue has been marked 'stale' after 90 days of inactivity. If there is no further activity, it will be closed in 7 days.