| |
@@ -76,6 +76,10 @@
|
| |
help=_("show xmlrpc debug output"))
|
| |
parser.add_option("--smtp-host", metavar="HOST",
|
| |
help=_("specify smtp server for notifications"))
|
| |
+ parser.add_option("--smtp-user", dest="smtp_user", metavar="USER",
|
| |
+ help=_("specify smtp username for notifications"))
|
| |
+ parser.add_option("--smtp-pass", dest="smtp_pass", metavar="PASSWORD",
|
| |
+ help=optparse.SUPPRESS_HELP) # do not allow passwords on a command line
|
| |
parser.add_option("--no-mail", action='store_false', default=True, dest="mail",
|
| |
help=_("don't send notifications"))
|
| |
parser.add_option("--send-mail", action='store_true', dest="mail",
|
| |
@@ -147,6 +151,8 @@
|
| |
['server', None, 'string'],
|
| |
['weburl', None, 'string'],
|
| |
['smtp_host', None, 'string'],
|
| |
+ ['smtp_user', None, 'string'],
|
| |
+ ['smtp_pass', None, 'string'],
|
| |
['from_addr', None, 'string'],
|
| |
['email_domain', None, 'string'],
|
| |
['mail', None, 'boolean'],
|
| |
@@ -424,6 +430,8 @@
|
| |
print("Sending warning notice to %s" % msg['To'])
|
| |
try:
|
| |
s = smtplib.SMTP(options.smtp_host)
|
| |
+ if options.smtp_user is not None and options.smtp_pass is not None:
|
| |
+ s.login(options.smtp_user, options.smtp_pass)
|
| |
s.sendmail(msg['From'], msg['To'], msg.as_string())
|
| |
s.quit()
|
| |
except:
|
| |
Add smtp authentication support for notifications mails sent out by the builder