Bug 961012, trychooser's -e and -f emails about finished jobs only work for MoCo employees who use their MoCo address, r=catlee
--- 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)