Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP eMail not working #3166

Open
Eulenbaer opened this issue May 29, 2024 · 16 comments
Open

SMTP eMail not working #3166

Eulenbaer opened this issue May 29, 2024 · 16 comments
Labels
setup issue possibly or definitely an issue with the user setup

Comments

@Eulenbaer
Copy link

Issue

Although configured according to the official configuration guide (https://docs.tandoor.dev/system/configuration/#email), tandoor seems to be incapable of sending mails.

I cant make out any attempt of tandoor to actually send a mail.

Tandoor Version

1.5.17

OS Version

Synology DSM 7.2.1-69057 Update 5

Setup

Docker / Docker-Compose

Reverse Proxy

No reverse proxy

Other

No response

Environment file

SECRET_KEY_FILE=/run/secrets/SECRET_KEY
DB_ENGINE=django.db.backends.postgresql
POSTGRES_HOST=<IP>
POSTGRES_DB=tandoor
POSTGRES_PORT=5432
POSTGRES_USER=tandoor
POSTGRES_PASSWORD_FILE=/run/secrets/DB_USR_PWD
DEBUG=0
ENABLE_METRICS=0
ENABLE_SIGNUP=0
REMOTE_USER_AUTH=0
EMAIL_HOST=smtp.domain.tld
EMAIL_PORT=587
EMAIL_HOST_USER=<login>
EMAIL_HOST_PASSWORD=/run/secrets/SMTP_PWD
EMAIL_USE_SSL=1
DEFAULT_FROM_EMAIL=<login>
FDC_API_KEY=/run/secrets/FDC_API
ACCOUNT_EMAIL_SUBJECT_PREFIX=[Tandoor Receipes]

Docker-Compose file

version: "3"

secrets:
  SECRET_KEY:
    file: '/volume1/docker/tandoor_stack/_secrets/secret_key.txt'
  DB_USR_PWD:
    file: '/volume1/docker/tandoor_stack/_secrets/db_usr_pwd.txt'
  SMTP_PWD:
    file: '/volume1/docker/tandoor_stack/_secrets/smtp_pwd.txt'
  FDC_API:
    file: '/volume1/docker/tandoor_stack/_secrets/fdc_api.txt'

services:
  web_recipes:
    image: 'vabene1111/recipes:1.5'
    container_name: 'tandoor-recipes'
    hostname: 'tandoor_recipes'
    restart: 'always'

    networks:
      docker_30:
        ipv4_address: <ip>

    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:8080 || exit 1
      timeout: 30s
      interval: 10s
      retries: 10

    volumes:
      - '/volume1/docker/tandoor_stack/tandoor/static:/opt/recipes/staticfiles'
      - '/volume1/docker/tandoor_stack/tandoor/media:/opt/recipes/mediafiles'

    secrets:
      - 'SECRET_KEY'
      - 'DB_USR_PWD'
      - 'SMTP_PWD'
      - 'FDC_API'

    env_file:
      - 'stack.env'

networks:
  docker_30:
    external: true

Relevant logs

No response

@Eulenbaer Eulenbaer added the setup issue possibly or definitely an issue with the user setup label May 29, 2024
@smilerz
Copy link
Collaborator

smilerz commented May 29, 2024

email works - you have the mail server setup incorrectly. Without additional details can't really tell you what's wrong.

@Eulenbaer
Copy link
Author

I tried Outlook and gmail SMTP servers. Same configuaration as for mail clients or other "mail senders".
Heck, pretty much my whole IoT runs on gmail, just Tandoor doesn't want to play.

@smilerz
Copy link
Collaborator

smilerz commented May 29, 2024

I tried Outlook and gmail SMTP servers. Same configuaration as for mail clients or other "mail senders". Heck, pretty much my whole IoT runs on gmail, just Tandoor doesn't want to play.

if you don't want to share details I can't help you.

@smilerz smilerz closed this as completed May 29, 2024
@Eulenbaer
Copy link
Author

for example? What is it you might require to further diagnose the problem?

@smilerz
Copy link
Collaborator

smilerz commented May 29, 2024

the email host

@Eulenbaer
Copy link
Author

mail.gmx.net

@smilerz
Copy link
Collaborator

smilerz commented May 29, 2024

This says the email port is 465

@Eulenbaer
Copy link
Author

The GMX documentation says otherwise: https://hilfe.gmx.net/pop-imap/pop3/serverdaten.html
Besides, both should work, and I tried both, SSL and TLS. Neither do work.

@smilerz
Copy link
Collaborator

smilerz commented May 29, 2024

SSL requires setting EMAIL_USE_SSL=1
if it is TLS you have to set EMAIL_USE_TLS=1 instead

@Eulenbaer
Copy link
Author

Thats what the documentation requires and what I tried.

In short, I used TLS configuration with EMAIL_USE_TLS=1 and Port 587
and I tried SSL with EMAIL_USE_SSL=1 and Port 465.
For gmail, Outlook and GMX respectively.

@smilerz
Copy link
Collaborator

smilerz commented May 29, 2024

The example you showed had SSL and port 587.

Did you rebuild the container between each configuration change?

@smilerz smilerz reopened this May 29, 2024
@Eulenbaer
Copy link
Author

Just reset the whole container.
Removed files from media & static, repulled image, droped postgres table.
Recreated container.

No change, mail still does not work.

Check from container via sh to ping google.de / mail.gmx.net, both resolved, both returned pong.

Where are log files of tandoor located? Do I need to switch to debug=1 to see some logs being generated?

@smilerz
Copy link
Collaborator

smilerz commented May 30, 2024

Just reset the whole container. Removed files from media & static, repulled image, droped postgres table. Recreated container.

No change, mail still does not work.

Check from container via sh to ping google.de / mail.gmx.net, both resolved, both returned pong.

Where are log files of tandoor located? Do I need to switch to debug=1 to see some logs being generated?

they are sent to std out - but smtp doesn't really generate any logs, so odds you see anything aren't super high, but possible!

@InfAmoUsaeble
Copy link

Just reset the whole container. Removed files from media & static, repulled image, droped postgres table. Recreated container.
No change, mail still does not work.
Check from container via sh to ping google.de / mail.gmx.net, both resolved, both returned pong.
Where are log files of tandoor located? Do I need to switch to debug=1 to see some logs being generated?

they are sent to std out - but smtp doesn't really generate any logs, so odds you see anything aren't super high, but possible!

Is there a reason why it doesn't contain the SMTP communication? It would help a ton to know, where the settings are broken or missing, or even what the receiving mail server relay has to say =)

I also can't make mails work, so I too would love some logs <3

@smilerz
Copy link
Collaborator

smilerz commented Jun 9, 2024

It's not in the logs because no one has written any logging.

@InfAmoUsaeble
Copy link

Thanks, I figured out my problem - I was using portainer to run the docker-compose file, which then meant that data was not actually saved... I started it with the docker compose command instead and the same settings as previously - Now SMTP is sending without a problem and I actually have data after new deploys :D

You learn something every day, thanks for your time - I hope this system is as good or better than it seems <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
setup issue possibly or definitely an issue with the user setup
Projects
None yet
Development

No branches or pull requests

3 participants