diff --git a/micromail.py b/micromail.py index 0a5973b..4fd5a00 100644 --- a/micromail.py +++ b/micromail.py @@ -58,9 +58,10 @@ class MicromailClient: sys.exit(1) self.features = self.ehlo() + print(self.features) - if self.starttls and "STARTTLS" in self.features: - self.starttls() + if self.starttls and b"STARTTLS" in self.features: + self.start_starttls() def login(self, username, password): self.username = username @@ -122,12 +123,13 @@ class MicromailClient: sys.exit(1) return res - def starttls(self): + def start_starttls(self): code, res = self.send_command(b"STARTTLS") if code != b"220": print(f"Error: got code {code} on STARTTLS") sys.exit(1) + print(res) self.socket = ssl.wrap_socket(self.socket) def new_message(self, to, sender=None):