]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport 1.12 and 1.13 and normalize whitespace (remove formfeeds):
authorRaymond Hettinger <python@rcn.com>
Sun, 6 Oct 2002 03:45:40 +0000 (03:45 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 6 Oct 2002 03:45:40 +0000 (03:45 +0000)
SF #515021, print the refused list to the DEBUGSTREAM, so the parameter is used
Note:  There is a TBD (aka FIXME) for how best to handle the refused addresses.

smtp_RCPT(): Removed a somewhat embarrassing debugging line, found by
Scot Stevenson.  Could be a bug fix candidate, but probably doesn't
matter much unless a certain blue-nosed cat suddenly becomes corporeal
and starts emailing some stmp.py (sic) fronted mailer.

Lib/smtpd.py

index eb0a9b91f3c3afc74fbcce2ddde603acff90b70c..7b614f3c4ea534e540d0a4131bffc8a6402d4ff2 100755 (executable)
@@ -35,7 +35,7 @@ given then 8025 is used.  If remotehost is not given then `localhost' is used,
 and if remoteport is not given, then 25 is used.
 """
 
-\f
+
 # Overview:
 #
 # This file implements the minimal SMTP protocol as defined in RFC 821.  It
@@ -96,7 +96,7 @@ EMPTYSTRING = ''
 COMMASPACE = ', '
 
 
-\f
+
 def usage(code, msg=''):
     print >> sys.stderr, __doc__ % globals()
     if msg:
@@ -104,7 +104,7 @@ def usage(code, msg=''):
     sys.exit(code)
 
 
-\f
+
 class SMTPChannel(asynchat.async_chat):
     COMMAND = 0
     DATA = 1
@@ -241,9 +241,6 @@ class SMTPChannel(asynchat.async_chat):
         if not address:
             self.push('501 Syntax: RCPT TO: <address>')
             return
-        if address.lower().startswith('stimpy'):
-            self.push('503 You suck %s' % address)
-            return
         self.__rcpttos.append(address)
         print >> DEBUGSTREAM, 'recips:', self.__rcpttos
         self.push('250 Ok')
@@ -271,7 +268,7 @@ class SMTPChannel(asynchat.async_chat):
         self.push('354 End data with <CR><LF>.<CR><LF>')
 
 
-\f
+
 class SMTPServer(asyncore.dispatcher):
     def __init__(self, localaddr, remoteaddr):
         self._localaddr = localaddr
@@ -318,7 +315,7 @@ class SMTPServer(asyncore.dispatcher):
         raise NotImplementedError
 
 
-\f
+
 class DebuggingServer(SMTPServer):
     # Do something with the gathered message
     def process_message(self, peer, mailfrom, rcpttos, data):
@@ -334,7 +331,7 @@ class DebuggingServer(SMTPServer):
         print '------------ END MESSAGE ------------'
 
 
-\f
+
 class PureProxy(SMTPServer):
     def process_message(self, peer, mailfrom, rcpttos, data):
         lines = data.split('\n')
@@ -348,7 +345,7 @@ class PureProxy(SMTPServer):
         data = NEWLINE.join(lines)
         refused = self._deliver(mailfrom, rcpttos, data)
         # TBD: what to do with refused addresses?
-        print >> DEBUGSTREAM, 'we got some refusals'
+        print >> DEBUGSTREAM, 'we got some refusals:', refused
 
     def _deliver(self, mailfrom, rcpttos, data):
         import smtplib
@@ -375,7 +372,7 @@ class PureProxy(SMTPServer):
         return refused
 
 
-\f
+
 class MailmanProxy(PureProxy):
     def process_message(self, peer, mailfrom, rcpttos, data):
         from cStringIO import StringIO
@@ -417,7 +414,7 @@ class MailmanProxy(PureProxy):
         if rcpttos:
             refused = self._deliver(mailfrom, rcpttos, data)
             # TBD: what to do with refused addresses?
-            print >> DEBUGSTREAM, 'we got refusals'
+            print >> DEBUGSTREAM, 'we got refusals:', refused
         # Now deliver directly to the list commands
         mlists = {}
         s = StringIO(data)
@@ -454,13 +451,13 @@ class MailmanProxy(PureProxy):
                 msg.Enqueue(mlist, torequest=1)
 
 
-\f
+
 class Options:
     setuid = 1
     classname = 'PureProxy'
 
 
-\f
+
 def parseargs():
     global DEBUGSTREAM
     try:
@@ -517,7 +514,7 @@ def parseargs():
     return options
 
 
-\f
+
 if __name__ == '__main__':
     options = parseargs()
     # Become nobody