[Commits] (bkirsch) fixes bug 1825 by making sure retries is a number between 0 and 5

commits at osafoundation.org commits at osafoundation.org
Tue Oct 12 10:33:37 PDT 2004


Commit by: bkirsch
Modified files:
chandler/parcels/osaf/mail/smtp.py 1.13 1.14

Log message:
fixes bug 1825 by making sure retries is a number between 0 and 5

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/mail/smtp.py.diff?r1=text&tr1=1.13&r2=text&tr2=1.14

Index: chandler/parcels/osaf/mail/smtp.py
diff -u chandler/parcels/osaf/mail/smtp.py:1.13 chandler/parcels/osaf/mail/smtp.py:1.14
--- chandler/parcels/osaf/mail/smtp.py:1.13	Fri Oct  8 12:14:51 2004
+++ chandler/parcels/osaf/mail/smtp.py	Tue Oct 12 10:33:35 2004
@@ -1,5 +1,5 @@
-__revision__  = "$Revision: 1.13 $"
-__date__      = "$Date: 2004/10/08 19:14:51 $"
+__revision__  = "$Revision: 1.14 $"
+__date__      = "$Date: 2004/10/12 17:33:35 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -216,7 +216,7 @@
         finally:
             self.restorePreviousView()
 
-        """Perform error checking to make sure To and From have values"""
+        """Perform error checking to make sure To, From, and retries have values"""
         if len(to_addrs) == 0:
             self.__fatalError("To Address")
             return
@@ -225,6 +225,11 @@
             self.__fatalError("From Address")
             return
 
+        """Basic retry logic check. Will refine as GUI support for retries is added"""
+        if not isinstance(retries, (int, long)) or (retries < 0 or retries > 5):
+            self.__fatalError("valid retry number between 0 and 5")
+            return
+
         self.factory = ChandlerESMTPSenderFactory(username, password, from_addr, to_addrs, msg,
                                                   d, retries, sslContext, heloFallback, 
                                                   authRequired, useSSL, useSSL)
@@ -460,10 +465,10 @@
 
     def __fatalError(self, str):
         """If a fatal error occurred before sending the message i.e. no To Address
-           then record the error, log it, and commit the mailMessage containing the 
+           then record the error, log it, and commit the mailMessage containing the
            error info"""
 
-        e = SMTPException("A '%s' is required to send an SMTP Mail Message" % str)
+        e = SMTPException("A %s is required to send an SMTP Mail Message." % str)
         self.__recordError(e)
         self.mailMessage.deliveryExtension.sendFailed()
 



More information about the Commits mailing list