Bug 961012, trychooser's -e and -f emails about finished jobs only work for MoCo employees who use their MoCo address, r=catlee
authorNick Thomas <nthomas@mozilla.com>
Tue, 21 Jan 2014 11:57:46 +1300
changeset 3498 a82681b92d605a4a1e4bff8dd54eaec16f1200aa
parent 3495 fc7ffebf89334090d658ffd3eb2551159854f46b
child 3499 a522f0214bfafb7a038a9093a08a2e38cf023b8a
push id2823
push usernthomas@mozilla.com
push dateMon, 20 Jan 2014 22:58:00 +0000
reviewerscatlee
bugs961012
Bug 961012, trychooser's -e and -f emails about finished jobs only work for MoCo employees who use their MoCo address, r=catlee
bin/try_mailer.py
--- a/bin/try_mailer.py
+++ b/bin/try_mailer.py
@@ -162,21 +162,23 @@ if __name__ == '__main__':
     parser = ArgumentParser()
     parser.add_argument("-f", "--from", dest="from_",
                         help="from email address", required=True)
     parser.add_argument(
         "-t", "--to", dest="to", help="to email address", action='append')
     parser.add_argument("--to-author", dest="to_author", help="send mail to build's owner", action="store_true")
     parser.add_argument(
         "--log-url", dest="log_url", help="url to uploaded log")
+    parser.add_argument("--relay", dest="relayhost", help="smtp host to send mail through")
     parser.set_defaults(
         to_author=False,
         to=[],
         from_=None,
-        log_url=None
+        log_url=None,
+        relayhost='mail.build.mozilla.org'
     )
 
     options, args = parser.parse_known_args()
 
     if not options.to and not options.to_author:
         parser.error("You must specify --to, or --to-author")
 
     if options.log_url:
@@ -222,12 +224,12 @@ if __name__ == '__main__':
     # Send it!
     if msgdict != None:
         if options.to_author:
             options.to.append(msgdict['author'])
         msg = formatMessage(msgdict, options.from_, options.to)
         print msg
 
         s = SMTP()
-        s.connect()
+        s.connect(options.relayhost)
         s.sendmail(options.from_, options.to, msg.as_string())
 
     sys.exit(exit_code)