Browse Source

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

guillaume chanaud 7 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
                 try:
73
                 try:
74
                     starttls_result = self._smtp_connection.starttls()
74
                     starttls_result = self._smtp_connection.starttls()
75
                     logger.debug(self, 'SMTP start TLS result: {}'.format(starttls_result))
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
                 except Exception as e:
78
                 except Exception as e:
77
                     logger.debug(self, 'SMTP start TLS error: {}'.format(e.__str__()))
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
             logger.info(self, 'Connection OK')
80
             logger.info(self, 'Connection OK')
82
 
81
 
83
     def disconnect(self):
82
     def disconnect(self):