From 6e33a67a8cb5011081e4dfb78b3082dd86ce8886 Mon Sep 17 00:00:00 2001 From: yvesf Date: Sat, 20 Feb 2010 22:50:36 +0100 Subject: mhonarc, maildir 2 rss --- smtp.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'smtp.py') diff --git a/smtp.py b/smtp.py index 96fd830..c23917b 100644 --- a/smtp.py +++ b/smtp.py @@ -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) -- cgit v1.2.1