[Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.59,1.60

Sjoerd Mullender sjoerd at users.sourceforge.net
Wed May 18 16:10:34 CEST 2005


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

Modified Files:
	sb_imapfilter.py 
Log Message:
In each iteration, create a new IMAPSession object and hence a new
connection to the server.  The old code was to create one IMAPSession
object and repeatedly login and logout from the server.  This,
however, can't work.  Login is only allowed when the IMAP server is in
the NONAUTH state, and logout leaves the server in the LOGOUT state.
In other words, login fails after a logout.  There is also no way to
change the state from LOGOUT to NONAUTH.


Index: sb_imapfilter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** sb_imapfilter.py	13 May 2005 04:23:11 -0000	1.59
--- sb_imapfilter.py	18 May 2005 14:10:30 -0000	1.60
***************
*** 1191,1195 ****
          imaps = []
          for server, port, username, password in servers_data:
!             imaps.append((IMAPSession(server, port, imapDebug, doExpunge),
                            username, password))
  
--- 1191,1195 ----
          imaps = []
          for server, port, username, password in servers_data:
!             imaps.append(((server, port, imapDebug, doExpunge),
                            username, password))
  
***************
*** 1206,1210 ****
          options.set_restore_point()
          while True:
!             for imap, username, password in imaps:
                  if options["globals", "verbose"]:
                      print "Account: %s:%s" % (imap.server, imap.port)
--- 1206,1211 ----
          options.set_restore_point()
          while True:
!             for (server, port, imapDebug, doExpunge), username, password in imaps:
!                 imap = IMAPSession(server, port, imapDebug, doExpunge)
                  if options["globals", "verbose"]:
                      print "Account: %s:%s" % (imap.server, imap.port)



More information about the Spambayes-checkins mailing list