authentik icon indicating copy to clipboard operation
authentik copied to clipboard

Can't send emails with SMTP - Getting Authentication Failed

Open EmilianoEscobedo opened this issue 1 year ago • 2 comments

Describe the bug Can't send emails with SMTP using zoho as mail provider, with Authentik deployed in docker-compose. I'm using SSL port 465. Getting Authentication Failed.

To Reproduce

  1. Use the environment variables to configure SMTP as documentation says.
  2. Complete those environment variables in .env file.
  3. Try to send a mail with ak test_mail, executing docker compose exec authentik-worker ak test_email <my_mail>

Expected behavior Test mail sent.

Screenshots image image

Logs image

Version and Deployment (please complete the following information):

  • authentik version: 2024.6.0
  • Deployment: docker-compose

Additional context

This instance of Authentik is hosted in a VM of a cloud provider and its restricted in port 80/443 to be only accessible thru a VPN.

Tried from an external online SMTP tester and is working as expected with the exact same server, port, and credentials.

image

EmilianoEscobedo avatar Jul 03 '24 03:07 EmilianoEscobedo

Hey all, I just downgraded to 2024.4.0 and everything is working as expected, so this seems to be a bug in this last release.

EmilianoEscobedo avatar Jul 04 '24 02:07 EmilianoEscobedo

same Version and deploymentmethod for me and i got this errormessage for testing E-Mail

ak-root/venv/lib/python3.12/site-packages/django/core/mail/backends/smtp.py", line 95, in open self.connection.login(self.username, self.password) File "/usr/local/lib/python3.12/smtplib.py", line 739, in login (code, resp) = self.auth( ^^^^^^^^^^ File "/usr/local/lib/python3.12/smtplib.py", line 641, in auth response = encode_base64(initial_response.encode('ascii'), eol='') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ builtins.UnicodeEncodeError: 'ascii' codec can't encode characters in position 21-22: ordinal not in range(128)"

flece avatar Jul 09 '24 11:07 flece

@flece could it be that in your .env file, the password entry has an invisible unicode character in it?

could both of you run dump_config to ensure authentik reads the .env file correctly? https://docs.goauthentik.io/docs/installation/configuration#verify-your-configuration-settings

BeryJu avatar Sep 26 '24 16:09 BeryJu

@BeryJu

i have the characters "ü" and "ß" in my password if i dump the config it is represented as: "\u00fc" and "\u00df"

if i change to a password without this characters it worked.

flece avatar Sep 27 '24 09:09 flece

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hi,

anything new? Complex passwords cause issues with some characters, is there another way to save them to config without the scripts breaking?

nicoduck avatar Nov 29 '24 18:11 nicoduck

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Ignoring issues doesn't fix them. What are you even expecting from stale-bot besides pissing off the community?

nicoduck avatar Feb 07 '25 17:02 nicoduck