[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.2-19-g4e69872

Sandro Tosi morph at debian.org
Sat May 9 14:37:07 UTC 2009


The following commit has been merged in the master branch:
commit 43c328574ecfc26eed3033aea26662ba92b6800d
Author: Carl Chenet <carl.chenet at ohmytux.com>
Date:   Sun May 3 16:05:05 2009 +0200

    limit smtp auth retry to 2 attempts

diff --git a/reportbug/submit.py b/reportbug/submit.py
index 2ee09ca..3c64011 100644
--- a/reportbug/submit.py
+++ b/reportbug/submit.py
@@ -349,6 +349,7 @@ def send_report(body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
 
         tryagain = True
         refused = None
+        retry = 0
         while tryagain:
             tryagain = False
             ewrite("Connecting to %s via SMTP...\n", smtphost)
@@ -382,7 +383,11 @@ def send_report(body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
                     ewrite('SMTP error: authentication failed.  Try again.\n')
                     tryagain = True
                     smtppasswd = None
-                    continue
+                    retry += 1
+                    if retry <= 2:
+                        continue
+                    else:
+                        tryagain = False
 
                 failed = True
                 ewrite('SMTP send failure: %s\n', x)

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list