ubccr / mokey

FreeIPA self-service account management portal
BSD 3-Clause "New" or "Revised" License
190 stars 45 forks source link

"Unencrypted connection" when sending email with TLS off #128

Closed mattgahs closed 8 months ago

mattgahs commented 9 months ago

Hello!

When I go to send emails from mokey (like password reset emails), the mokey debug logs show: ERRO[0031] unencrypted connection

I have smtp_tls = "off" and the issue persists. I've tracked this down to the fact that, even with TLS off, the smtp_username and smtp_password fields being uncommented causes mokey to send those values (even if null) to the SMTP server, which thinks it's trying to send with credentials, and fails.

I commented out smtp_username and smtp_password, and I am able to successfully send unencrypted emails. My recommendation is that if smtp_tls = "off" is the default setting, to also comment out smtp_username and smtp_password in the mokey.topl file. If a user wishes to use TLS, they can uncomment the relevant arguments.

I'm not savvy enough with pull requests, so i'm not sure how to do it.

mattgahs commented 9 months ago

I think I created a pull request! see https://github.com/ubccr/mokey/pull/129