[Spambayes-checkins] spambayes smtpproxy.py,1.11,1.12

Tony Meyer anadelonbrin at users.sourceforge.net
Thu Aug 28 02:57:00 EDT 2003


Update of /cvsroot/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv22169

Modified Files:
	smtpproxy.py 
Log Message:
Try a bit harder to proxy the exact command if we aren't going anything with it,
and try to match it more closely even if we are.

Index: smtpproxy.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/smtpproxy.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** smtpproxy.py	26 Aug 2003 06:49:56 -0000	1.11
--- smtpproxy.py	28 Aug 2003 08:56:57 -0000	1.12
***************
*** 208,214 ****
              # A proper command.
              if self.request[:10].upper() == "MAIL FROM:":
!                 splitCommand = self.request.strip().split(":", 1)
              elif self.request[:8].upper() == "RCPT TO:":
!                 splitCommand = self.request.strip().split(":", 1)
              else:
                  splitCommand = self.request.strip().split(None, 1)
--- 208,214 ----
              # A proper command.
              if self.request[:10].upper() == "MAIL FROM:":
!                 splitCommand = self.request.split(":", 1)
              elif self.request[:8].upper() == "RCPT TO:":
!                 splitCommand = self.request.split(":", 1)
              else:
                  splitCommand = self.request.strip().split(None, 1)
***************
*** 230,233 ****
--- 230,235 ----
              if cooked is not None:
                  self.serverSocket.push(cooked + '\r\n')
+                 print "pulled: '%s'" % self.request
+                 print "pushed: '%s'" % cooked
          self.command = self.args = self.request = ''
  
***************
*** 349,356 ****
          else:
              self.blockData = False
!         rv = command + ':'
!         for arg in args:
!             rv += ' ' + arg
!         return rv
          
      def onData(self, command, args):
--- 351,355 ----
          else:
              self.blockData = False
!         return "%s:%s" % (command, ' '.join(args))
          
      def onData(self, command, args):
***************
*** 371,376 ****
      def onUnknown(self, command, args):
          """Default handler."""
!         rv = "%s %s" % (command, ' '.join(args))
!         return rv
  
  
--- 370,374 ----
      def onUnknown(self, command, args):
          """Default handler."""
!         return self.request
  
  





More information about the Spambayes-checkins mailing list