From: Yann Dirson Date: Mon, 16 Jul 2007 22:48:30 +0000 (+0100) Subject: Display a message when the server refused some recipients. X-Git-Tag: v0.13~11 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/0bc1343cccdec319c49b0f7c21a29236158d08c9?ds=sidebyside Display a message when the server refused some recipients. When the smtp server directly refuses some recipients, an exception is only raised when no recipient got the parcel. This patch displays the recipients which were denied. Subsequent delivery is still done, no change here. Signed-off-by: Yann Dirson --- diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index e364733..cb8dc74 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -179,7 +179,9 @@ def __send_message(smtpserver, from_addr, to_addr_list, msg, sleep, s.ehlo() s.login(smtpuser, smtppassword) - s.sendmail(from_addr, to_addr_list, msg) + result = s.sendmail(from_addr, to_addr_list, msg) + if len(result): + print "mail server refused delivery for the following recipients: %s" % result # give recipients a chance of receiving patches in the correct order time.sleep(sleep) except Exception, err: