Browse Source

Sending mail without authentication, connect() method is called only if login is set

guillaume chanaud 6 years ago
parent
commit
bed507fdae
1 changed files with 2 additions and 3 deletions
  1. 2 3
      tracim/tracim/lib/email.py

+ 2 - 3
tracim/tracim/lib/email.py View File

@@ -73,11 +73,10 @@ class EmailSender(object):
73 73
                 try:
74 74
                     starttls_result = self._smtp_connection.starttls()
75 75
                     logger.debug(self, 'SMTP start TLS result: {}'.format(starttls_result))
76
+                    login_res = self._smtp_connection.login(self._smtp_config.login, self._smtp_config.password)
77
+                    logger.debug(self, 'SMTP login result: {}'.format(login_res))
76 78
                 except Exception as e:
77 79
                     logger.debug(self, 'SMTP start TLS error: {}'.format(e.__str__()))
78
-
79
-            login_res = self._smtp_connection.login(self._smtp_config.login, self._smtp_config.password)
80
-            logger.debug(self, 'SMTP login result: {}'.format(login_res))
81 80
             logger.info(self, 'Connection OK')
82 81
 
83 82
     def disconnect(self):