offen / offen

Offen Fair Web Analytics

Home Page:https://www.offen.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error message when sending E-Mail - but E-Mail is sent

tobru opened this issue · comments

When requesting a password reset, an error is displayed, but the E-Mail is still delivered:

An error occurred: error sending email message: failed to close connction: not connected to SMTP server

require<[3]</t.exports/<@https://offen.example.com/vault/index-b299dadd09.js:13:13989

The configuration:

OFFEN_SMTP_USER="offen@www.example.com"
OFFEN_SMTP_PASSWORD="SECRET"
OFFEN_SMTP_HOST="smtp.eu.mailgun.org"
OFFEN_SMTP_PORT="587"
OFFEN_SMTP_SENDER="offen@www.example.com"
OFFEN_SMTP_AUTHTYPE="PLAIN"

I wouldn't expect an error message, because the password reset message is properly delivered and works as expected.

I would think this was introduced in #817 - have you seen this error message before by any chance @wneessen ?

In theory I have seen it (codewise) but I've never seen it actually happening. The error happens when the code tries to close the SMTP connection after successfully sending the mail (basically sending a SMTP "QUIT" message to server). The message states that it wasn't able to do this, as the SMTP connection was not active anymore. In an ideal scenario this should never happen.

If you want, I can change the code to ignore the close errors, as they do not affect anything in the offen context but then again that error should be very uncommon and only happen in weird server/connection scenarios. I'm happy to commit a PR if you want, but I'll leave the decision up to you.

@wneessen Thanks for looking into this. If it's an easy thing to do, I'd appreciate a patch as described. Thank you

This should be fixed in v1.4.1

Wohoo, I can confirm that the issue is fixed. Thanks a lot for taking care and the quick fix ❤️