[Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.32,1.33

Tony Meyer anadelonbrin at users.sourceforge.net
Wed Jul 14 10:59:29 CEST 2004


Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17618/scripts

Modified Files:
	sb_imapfilter.py 
Log Message:
Fix [ 959937 ] "Invalid server" message not always correct

Index: sb_imapfilter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** sb_imapfilter.py	24 May 2004 06:23:26 -0000	1.32
--- sb_imapfilter.py	14 Jul 2004 08:59:27 -0000	1.33
***************
*** 203,207 ****
          try:
              BaseIMAP.__init__(self, server, port)
!         except:
              # A more specific except would be good here, but I get
              # (in Python 2.2) a generic 'error' and a 'gaierror'
--- 203,207 ----
          try:
              BaseIMAP.__init__(self, server, port)
!         except (BaseIMAP.error, socket.gaierror, socket.error):
              # A more specific except would be good here, but I get
              # (in Python 2.2) a generic 'error' and a 'gaierror'
***************
*** 209,213 ****
              # or invalid domain (respectively)
              print "Invalid server or port, please check these settings."
!             sys.exit(-1)
          self.debug = debug
          # For efficiency, we remember which folder we are currently
--- 209,213 ----
              # or invalid domain (respectively)
              print "Invalid server or port, please check these settings."
!             sys.exit()
          self.debug = debug
          # For efficiency, we remember which folder we are currently
***************
*** 223,227 ****
              BaseIMAP.login(self, username, pwd)  # superclass login
          except BaseIMAP.error, e:
!             if str(e) == "permission denied":
                  print "There was an error logging in to the IMAP server."
                  print "The userid and/or password may be incorrect."
--- 223,227 ----
              BaseIMAP.login(self, username, pwd)  # superclass login
          except BaseIMAP.error, e:
!             if str(e) == "permission denied" or str(e) == "Login failed.":
                  print "There was an error logging in to the IMAP server."
                  print "The userid and/or password may be incorrect."



More information about the Spambayes-checkins mailing list