commentoplusplus icon indicating copy to clipboard operation
commentoplusplus copied to clipboard

unable to send mails using STARTTLS

Open Loosetooth opened this issue 1 year ago • 6 comments

Currently, it is impossible to send mails using STARTTLS, I get the following error in the logs:

2022/10/21 11:40:20 [ERROR] smtp_email_notification.go:48 smtpEmailNotification(): cannot send email notification email: 530 Must issue a STARTTLS command first.

The fix is relatively straightforward, in smtp_send.go the following line needs to be added when using STARTTLS:

server.Encryption = mail.EncryptionSTARTTLS

I will try to make a pull request to add the fix.

Loosetooth avatar Oct 21 '22 12:10 Loosetooth

I have a similar problem (Docker). With the original Commento there is no problem with the same configuration. I use Zoho mail. My configuration:

COMMENTO_SMTP_HOST=smtp.zoho.eu
COMMENTO_SMTP_PORT=587
COMMENTO_SMTP_USERNAME=[myzohousername]
COMMENTO_SMTP_PASSWORD=[REDACTED]
[email protected]

The error, when i try to reset password, is:

2022/10/25 13:24:55 [ERROR] smtp_reset_hex.go:19 smtpResetHex(): cannot send reset email: 530 Must issue a STARTTLS command first.

tealaforgia avatar Oct 25 '22 13:10 tealaforgia

Have just merged this fix! @tealaforgia please try the latest docker image, with USE_STARTTLS=true

souramoo avatar Oct 25 '22 13:10 souramoo

Thanks, now the bug seems to be fixed.Email are sended correctly with my configuration.

tealaforgia avatar Oct 25 '22 14:10 tealaforgia

@tealaforgia Sorry to bother you but how did you get it working with Zoho? I have used the exact same configuration as yours (but with .com) but I'm getting:

[ERROR] smtp_reset_hex.go:19 smtpResetHex(): cannot send reset email: 553 Relaying disallowed as @

This is my config:

COMMENTO_SMTP_HOST=smtp.zoho.com
COMMENTO_SMTP_PORT=587
[email protected]
COMMENTO_SMTP_PASSWORD=mypassword
[email protected]

I also have "[email protected]" configured in Zoho as alias. Note that I'm using the latest release not the latest commit, but at least I should get the STARTTLS error first, no? I've also tried the same FROM address as the login name. I have two factor auth enabled but created an app password - the same config works with Vaultwarden so no idea what the problem is. Maybe I overlooked something? 🤔

Brawl345 avatar Nov 25 '22 20:11 Brawl345

Ok I had to use the latest commit then everything worked plus the above issue was fixed. Of course USE_STARTTLS must be true.

Brawl345 avatar Nov 26 '22 10:11 Brawl345

SMTP only worked for me after adding this variable:

USE_STARTTLS = true

ugurkocde avatar Oct 05 '23 15:10 ugurkocde