diff options
Diffstat (limited to 'smtp.py')
-rw-r--r-- | smtp.py | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -24,10 +24,20 @@ class SMTPChannel(asynchat.async_chat): self.server.logger.debug("Write: " + data) asynchat.async_chat.push(self,data) + def handle_close(self): + asynchat.async_chat.handle_close(self) + if self.read_data and len(self.data) > 10: + #QUIT oder "." wurde nicht erkannt + mail = email.message_from_string(self.data) + key=self.server.maildir.add(mail) + self.server.logger.info("New Mail: %s" % key) + self.server.maildir.flush() + + def found_terminator(self): try: if self.read_data: - if self.data.endswith(".") or self.data.endswith(".\r"): + if self.data.endswith("\n.") or self.data.endswith("\n.\r"): self.read_data = False self.push("250 Ok: queued as 12345\n") mail = email.message_from_string(self.data) |