Anonymous committed 67377fd

applied smth_auth options update patch

  • Participants
  • Parent commits f0437ae
  • Branches beta

Comments (0)

Files changed (3)

File rhodecode/config/deployment.ini_tmpl

 #smtp_port = 
 #smtp_use_tls = false
 #smtp_use_ssl = true
+# Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
+#smtp_auth = 
 ##nr of threads to spawn

File rhodecode/lib/celerylib/

     tls = str2bool(email_config.get('smtp_use_tls'))
     ssl = str2bool(email_config.get('smtp_use_ssl'))
     debug = str2bool(config.get('debug'))
+    smtp_auth = email_config.get('smtp_auth')
-        m = SmtpMailer(mail_from, user, passwd, mail_server,
+        m = SmtpMailer(mail_from, user, passwd, mail_server,smtp_auth,
                        mail_port, ssl, tls, debug=debug)
         m.send(recipients, subject, body)

File rhodecode/lib/

 from email import encoders
 class SmtpMailer(object):
     """SMTP mailer class
-    def __init__(self, mail_from, user, passwd, mail_server,
+    def __init__(self, mail_from, user, passwd, mail_server,smtp_auth,
                     mail_port=None, ssl=False, tls=False, debug=False):
         self.mail_from = mail_from
         self.ssl = ssl
         self.tls = tls
         self.debug = debug
+        self.auth = smtp_auth
     def send(self, recipients=[], subject='', body='', attachment_files=None):
+        if self.auth:
+            smtp_serv.esmtp_features["auth"] = self.auth
         #if server requires authorization you must provide login and password
         #but only if we have them