mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-15 06:45:23 -05:00
feat: extend email support for SSL/No Auth Email Support (#1235)
* Changes Settings to use new SMTP_AUTH_STRATEGY variable in place of SMTP_TLS with transition support #1187 * Wires up default email client to use ssl or tls authentication if enabled in settings * Updates the docs * Update template file * remove SMTP_TLS and use staticmethod for validate * consolidate test cases with params Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
@@ -24,8 +24,10 @@ class DefaultEmailSender(ABCEmailSender, BaseService):
|
||||
)
|
||||
|
||||
smtp_options: dict[str, str | bool] = {"host": self.settings.SMTP_HOST, "port": self.settings.SMTP_PORT}
|
||||
if self.settings.SMTP_TLS:
|
||||
if self.settings.SMTP_AUTH_STRATEGY.upper() == "TLS":
|
||||
smtp_options["tls"] = True
|
||||
if self.settings.SMTP_AUTH_STRATEGY.upper() == "SSL":
|
||||
smtp_options["ssl"] = True
|
||||
if self.settings.SMTP_USER:
|
||||
smtp_options["user"] = self.settings.SMTP_USER
|
||||
if self.settings.SMTP_PASSWORD:
|
||||
|
||||
Reference in New Issue
Block a user