Skip to content

Commit

Permalink
Change ssl configuration for serval app
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Oct 30, 2023
1 parent 4215b56 commit 0a331fc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions samples/ServalApp/serval_email_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(
password,
sender_address="[email protected]",
host="mail.languagetechnology.org",
port=465,
port=587,
) -> None:
self.__password = password
self.sender_address = sender_address
Expand All @@ -23,7 +23,10 @@ def password(self):

def __enter__(self):
context = ssl.create_default_context() # ssl.SSLContext(ssl.PROTOCOL_SSLv23)
self.server = smtplib.SMTP_SSL(host=self.host, port=self.port, context=context)
self.server = smtplib.SMTP(host=self.host, port=self.port)
self.server.ehlo()
self.server.starttls(context=context)
self.server.ehlo()
self.server.login(self.sender_address, self.__password)
return self

Expand Down

0 comments on commit 0a331fc

Please sign in to comment.