Skip to content

Commit

Permalink
remove deprecated (and not used mail_certfile and mail_keyfile)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlundberg committed Sep 3, 2024
1 parent 902e0de commit 8139456
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/eduid/common/config/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class MsgConfig(WorkerConfig):

audit: bool = True
devel_mode: bool = False
mail_certfile: str = ""
mail_host: str = "localhost"
mail_keyfile: str = ""
mail_password: str = ""
mail_port: int = 25
mail_starttls: bool = False
Expand Down
6 changes: 2 additions & 4 deletions src/eduid/workers/msg/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import smtplib
from collections import OrderedDict
from ssl import SSLContext
from typing import Any, Optional

from celery import Task
Expand Down Expand Up @@ -55,10 +56,7 @@ def smtp(self) -> smtplib.SMTP:
config = MsgCelerySingleton.worker_config
_smtp = smtplib.SMTP(config.mail_host, config.mail_port)
if config.mail_starttls:
if config.mail_keyfile and config.mail_certfile:
_smtp.starttls(config.mail_keyfile, config.mail_certfile)
else:
_smtp.starttls()
_smtp.starttls()
if config.mail_username and config.mail_password:
_smtp.login(config.mail_username, config.mail_password)
return _smtp
Expand Down

0 comments on commit 8139456

Please sign in to comment.