whythawk / full-stack-fastapi-postgresql

Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Nuxt3, Docker, automatic HTTPS and more.
MIT License
231 stars 47 forks source link

Sending email with SSL/TLS does not work #8

Closed raouldo closed 1 year ago

raouldo commented 1 year ago

Hello,

After several attempts, I couldn't configure the emails to receive them correctly with a common SMTP configuration with SSL on.

Steps to reproduce.

  1. pip install cookiecutter
  2. cookiecutter https://github.com/whythawk/full-stack-fastapi-postgresql
  3. Add a SMTP configuration (==> add SMTP_TLS=True in .env by default)
  4. docker-compose up
  5. Try to send a magic link or a reset password email. => Nothing happen.

After few research, I find out that the configuration inside backend (utilities) is not correct. See python-emails documentation here: https://python-emails.readthedocs.io/en/latest/ Must replace tls by ssl inside the file.

Do you see a better idea?

turukawa commented 1 year ago

@raouldo I'll raise this to a cookiecutter setting and include in the mail utilities. That way you get some flexibility depending on the mail server you're using. My test was fine with them as is, but obviously this isn't ubiquitous.

turukawa commented 1 year ago

@raouldo OK, updated. I note that python-emails also supports DKIM signatures. That something I should include, or adding yet another layer of complexity too far?

turukawa commented 1 year ago

Release 0.7.1 should fix this.