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

🐞 Bug - Empty user and password for SMTP #3579

Open
4 tasks
B-Prod opened this issue Nov 28, 2024 · 3 comments
Open
4 tasks

🐞 Bug - Empty user and password for SMTP #3579

B-Prod opened this issue Nov 28, 2024 · 3 comments
Assignees

Comments

@B-Prod
Copy link

B-Prod commented Nov 28, 2024

🖥️ Site(s) concerné(s)

  • DomiFa - côté structures
  • Mon DomiFa - portail domiciliés
  • Admin DomiFa
  • Metabase

🚫 Description du problème

When defining the SMTP credentials, we need to specify an empty user and password.

This leads to the following error, as the related variables DOMIFA_MAIL_SMTP_MAILTRAP_USER and DOMIFA_MAIL_SMTP_MAILTRAP_PASSWORD are set as required and does not allow empty strings:

[configParser] missing required env value "DOMIFA_MAIL_SMTP_MAILTRAP_USER"

However in local, we would like to use mailhog with the following settings:

      DOMIFA_MAIL_SMTP_MAILTRAP_HOST: mailhog
      DOMIFA_MAIL_SMTP_MAILTRAP_PORT: 1025
      DOMIFA_MAIL_SMTP_MAILTRAP_USER: ''
      DOMIFA_MAIL_SMTP_MAILTRAP_PASSWORD: ''

Moreover, the variable DOMIFA_TIPIMAIL_FROM_EMAIL is required, even if the chosen email provider is MAILTRAP.

Structure concernée (optionnel)

No response

🔮 Comportement attendu

Make the DOMIFA_TIPIMAIL_FROM_EMAIL environment variable required only if the mail provider is TIPIMAIL.

Allow empty string for user and password in mail configuration.

@B-Prod
Copy link
Author

B-Prod commented Nov 28, 2024

The patch below fixes the 2 issues:

domifa-email-configuration-3579.patch

@pYassine
Copy link
Contributor

You can add change "DOMIFA_MAIL_SMTP_TIPIMAIL_HOST" by mailtrap. It will make tipimail variables as optionnal

@B-Prod
Copy link
Author

B-Prod commented Nov 28, 2024

Thank you.

So the MAILTRAP variables should not be used at all?

If I switch all environment variables to use TIPIMAIL instead of MAILTRAP, I don't have the issue.
However, the MAILTRAP sender is the one defined in some .env example files, maybe it should be changed to TIPIMAIL.

The provided patch also fixes another issue with empty username and password. Even if using TIPIMAIL variables, empty user or password is not allowed:

missing required env value "DOMIFA_MAIL_SMTP_TIPIMAIL_USER"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants