From 6a223fe77e367aca61dbfdb797ea090834a0ee8e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 23 Jul 2012 12:51:50 +0530 Subject: [PATCH] fixes in receive email --- erpnext/support/doctype/support_ticket/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/support/doctype/support_ticket/__init__.py b/erpnext/support/doctype/support_ticket/__init__.py index a4a984fe35d..c36dc4179ed 100644 --- a/erpnext/support/doctype/support_ticket/__init__.py +++ b/erpnext/support/doctype/support_ticket/__init__.py @@ -67,7 +67,9 @@ class SupportMailbox(POP3Mailbox): import re re_result = re.findall('(?<=\<)(\S+)(?=\>)', mail.mail['From']) if re_result and re_result[0]: email_id = re_result[0] - + + from webnotes.utils import decode_email_header + full_email_id = decode_email_header(mail.mail['From']) for thread_id in thread_list: exists = webnotes.conn.sql("""\ @@ -79,7 +81,7 @@ class SupportMailbox(POP3Mailbox): from webnotes.model.code import get_obj st = get_obj('Support Ticket', thread_id) - st.make_response_record(content, mail.mail['From'], content_type) + st.make_response_record(content, full_email_id, content_type) # to update modified date #webnotes.conn.set(st.doc, 'status', 'Open') @@ -99,7 +101,7 @@ class SupportMailbox(POP3Mailbox): d = Document('Support Ticket') d.description = content d.subject = mail.mail['Subject'] - d.raised_by = mail.mail['From'] + d.raised_by = full_email_id d.content_type = content_type d.status = 'Open' d.naming_series = opts and opts.split("\n")[0] or 'SUP'