From 31347ee3ee9efb105d38e10a612314e1d7bae7c2 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 15 Jul 2011 11:20:44 +0530 Subject: [PATCH] cleanup of pop3 mail --- cgi-bin/webnotes/utils/email_lib/receive.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cgi-bin/webnotes/utils/email_lib/receive.py b/cgi-bin/webnotes/utils/email_lib/receive.py index 3827fa46e3..7207d836f0 100644 --- a/cgi-bin/webnotes/utils/email_lib/receive.py +++ b/cgi-bin/webnotes/utils/email_lib/receive.py @@ -93,9 +93,13 @@ class POP3Mailbox: """ settings_doc must contain is_ssl, host, username, password + (by name or object) """ - from webnotes.model.doc import Document - self.settings = Document(settings_doc, settings_doc) + if type(settings_doc)==str: + from webnotes.model.doc import Document + self.settings = Document(settings_doc, settings_doc) + else: + self.settings = settings_doc def connect(self): """ @@ -133,7 +137,7 @@ class POP3Mailbox: To be overridden If mailbox is to be scanned, returns true """ - return true + return True def process_message(self, mail): """