diff roundup/mailgw.py @ 6638:e1588ae185dc issue2550923_computed_property

merge from default branch. Fix travis.ci so CI builds don't error out
author John Rouillard <rouilj@ieee.org>
date Thu, 21 Apr 2022 16:54:17 -0400
parents 3e8f2104753b
children 408fd477761f
line wrap: on
line diff
--- a/roundup/mailgw.py	Fri Oct 08 00:37:16 2021 -0400
+++ b/roundup/mailgw.py	Thu Apr 21 16:54:17 2022 -0400
@@ -112,6 +112,7 @@
 from roundup.hyperdb import iter_roles
 from roundup.anypy.strings import StringIO, b2s, u2s
 import roundup.anypy.random_ as random_
+import roundup.anypy.ssl_ as ssl_
 
 try:
     import gpg, gpg.core, gpg.constants, gpg.constants.sigsum
@@ -1373,7 +1374,7 @@
             else:
                 self.logger.debug('Trying server %r without ssl' % server)
                 server = imaplib.IMAP4(server)
-        except (imaplib.IMAP4.error, socket.error, socket.sslerror):
+        except (imaplib.IMAP4.error, socket.error, ssl_.SSLError):
             self.logger.exception('IMAP server error')
             return 1
 
@@ -1415,7 +1416,7 @@
         finally:
             try:
                 server.expunge()
-            except (imaplib.IMAP4.error, socket.error, socket.sslerror):
+            except (imaplib.IMAP4.error, socket.error, ssl_.SSLError):
                 pass
             server.logout()
 
@@ -1461,7 +1462,7 @@
             else:
                 klass = poplib.POP3
             server = klass(server)
-        except socket.error:
+        except (socket.error, ssl_.SSLError):
             self.logger.exception('POP server error')
             return 1
         if apop:

Roundup Issue Tracker: http://roundup-tracker.org/