Changeset - 67377fd685be
[Not reviewed]
beta
0 3 0
Les Peabody - 14 years ago 2011-10-20 17:58:11
lpeabody@ccom.unh.edu
applied smth_auth options update patch
3 files changed with 9 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -24,6 +24,8 @@ pdebug = false
 
#smtp_port = 
 
#smtp_use_tls = false
 
#smtp_use_ssl = true
 
# Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
 
#smtp_auth = 
 

	
 
[server:main]
 
##nr of threads to spawn
rhodecode/lib/celerylib/tasks.py
Show inline comments
 
@@ -356,9 +356,10 @@ def send_email(recipients, subject, body
 
    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')
 

	
 
    try:
 
        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)
 
    except:
rhodecode/lib/smtp_mailer.py
Show inline comments
 
@@ -36,6 +36,7 @@ from email.utils import formatdate
 
from email import encoders
 

	
 

	
 

	
 
class SmtpMailer(object):
 
    """SMTP mailer class
 

	
 
@@ -49,7 +50,7 @@ class SmtpMailer(object):
 

	
 
    """
 

	
 
    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
 
@@ -60,6 +61,7 @@ class SmtpMailer(object):
 
        self.ssl = ssl
 
        self.tls = tls
 
        self.debug = debug
 
        self.auth = smtp_auth
 

	
 
    def send(self, recipients=[], subject='', body='', attachment_files=None):
 

	
 
@@ -78,6 +80,8 @@ class SmtpMailer(object):
 
            smtp_serv.set_debuglevel(1)
 

	
 
        smtp_serv.ehlo()
 
        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
0 comments (0 inline, 0 general)