Anonymous avatar Anonymous committed bb4aaae

small refactorings

Comments (0)

Files changed (1)

pymta/command_parser.py

     as a complete command is received, this class will hand everything over to
     the SMTPSession.
     
-    In the original 'SMTPChannel' class from Python.org this class handled 
-    all communication with asynchat, implemented a extremly simple state machine
-    and processed the data. Implementing hooks in that design (or adding 
-    fine-grained policies) was not possible at all with the previous design."""
+    The original 'SMTPChannel' class from Python.org handled all communication 
+    with asynchat, implemented a extremly simple state machine and processed 
+    the data. Implementing hooks in that design (or adding fine-grained 
+    policies) was not possible at all with the previous design."""
     LINE_TERMINATOR = '\r\n'
 
     def __init__(self, server, connection, remote_ip_and_port, policy):
             # Remove extraneous carriage returns and de-transparency according
             # to RFC 821, Section 4.5.2.
             data = []
-            for text in line.split('\r\n'):
+            for text in line.split(self.LINE_TERMINATOR):
                 if text and text[0] == '.':
                     data.append(text[1:])
                 else:
     # Internal methods for sending data to the client (easy subclassing with
     # different behavior)
 
-    def smtp_helo(self):
-        if self.command_arguments in [None, '']:
-            self.push('501 Syntax: HELO hostname')
-        else:
-            self._greeting = self.command_arguments
-            self.push('250 %s' % self._fqdn)        
-
     # -------------------------------------------------------------------------
     # Methods that call policy checks
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.