Explorar el Código

[fix] email fixes from failed scheduler logs

version-14
Rushabh Mehta hace 8 años
committed by Nabin Hait
padre
commit
72117dd5d3
Se han modificado 2 ficheros con 8 adiciones y 2 borrados
  1. +1
    -1
      frappe/email/doctype/email_account/email_account.py
  2. +7
    -1
      frappe/email/receive.py

+ 1
- 1
frappe/email/doctype/email_account/email_account.py Ver fichero

@@ -483,7 +483,7 @@ class EmailAccount(Document):
parent = frappe.new_doc(self.append_to)

if self.subject_field:
parent.set(self.subject_field, frappe.as_unicode(email.subject))
parent.set(self.subject_field, frappe.as_unicode(email.subject)[:140])

if self.sender_field:
parent.set(self.sender_field, frappe.as_unicode(email.from_email))


+ 7
- 1
frappe/email/receive.py Ver fichero

@@ -112,6 +112,10 @@ class EmailServer:
self.uid_reindexed = False

uid_list = email_list = self.get_new_mails()

if not email_list:
return

num = num_copy = len(email_list)

# WARNING: Hard coded max no. of messages to be popped
@@ -166,11 +170,13 @@ class EmailServer:
def get_new_mails(self):
"""Return list of new mails"""
if cint(self.settings.use_imap):
email_list = []
self.check_imap_uidvalidity()

self.imap.select("Inbox", readonly=True)
response, message = self.imap.uid('search', None, self.settings.email_sync_rule)
email_list = message[0].split()
if message[0]:
email_list = message[0].split()
else:
email_list = self.pop.list()[1]



Cargando…
Cancelar
Guardar