[SOLVED] Pull from email account periodic errors (gmail account)

I use the latest ERPnext instance supported by ERPNext team.
ERPNext: v11.1.38 (master)
ERPNext Support: v0.0.1 (master)
Frappe Framework: v11.1.35 (master)

I have the following periodic message in my error log. I do not understand what’s going on since my email are fetched and displayed accordingly. Why is this error showing up?

Thanks in advance for your support.

{‘event’: u’all’, ‘retry’: 0, ‘log’: <function log at 0x7f9adf157398>, ‘site’: u’mysite.erpnext.com’, ‘job_name’: u’pull_from_email_account|My name email’, ‘method_name’: u’pull_from_email_account’, ‘method’: <function pull_from_email_account at 0x7f9adf0d46e0>, ‘user’: u’Administrator’, ‘kwargs’: {‘email_account’: u’My name email’}, ‘is_async’: True}
Traceback (most recent call last):
File “/home/frappe/benches/bench-11-2019-06-05/apps/frappe/frappe/utils/background_jobs.py”, line 103, in execute_job
File “/home/frappe/benches/bench-11-2019-06-05/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 713, in pull_from_email_account
File “/home/frappe/benches/bench-11-2019-06-05/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 261, in receive
emails = email_server.get_messages()
File “/home/frappe/benches/bench-11-2019-06-05/apps/frappe/frappe/email/receive.py”, line 116, in get_messages
uid_list = email_list = self.get_new_mails()
File “/home/frappe/benches/bench-11-2019-06-05/apps/frappe/frappe/email/receive.py”, line 176, in get_new_mails
File “/home/frappe/benches/bench-11-2019-06-05/apps/frappe/frappe/email/receive.py”, line 193, in check_imap_uidvalidity
response, message = self.imap.status(“Inbox”, “(UIDVALIDITY UIDNEXT)”)
File “/usr/lib64/python2.7/imaplib.py”, line 723, in status
typ, dat = self._simple_command(name, mailbox, names)
File “/usr/lib64/python2.7/imaplib.py”, line 1083, in _simple_command
return self._command_complete(name, self._command(name, *args))
File “/usr/lib64/python2.7/imaplib.py”, line 912, in _command_complete
raise self.abort(‘command: %s => %s’ % (name, val))
abort: command: STATUS => socket error: EOF


I’m only guessing but I think you have a rogue email vin there that isn’t being parsed correctly. Spam emails often don’t follow the correct RFC protocol and can therefore sometimes trip up a system such as this . I’ve had the same myself.

I would check yr IMAP mailbox in a mail application such as Thunderbird and remove any obviously spam or virus emails and let ERPNext try polling the mail queue again

Hi Julian,
Thanks for your answer.
Unfortunately, I did not catch the point. It is barely impossible to imagine that i will never have a spam email in the coming days.
I do not have any warnings of the same type from Thunderbird and everything works fine.
So what’s happen with ErpNext?
Am i alone?


If I’m right about this, it’s probably only a single email which is so badly formatted that ERPNext cannot parse it correctly. You must remember that Thunderbird has been refined for twenty years and even then I’ve very occasionally had spam emails that have made thunderbird barf.

Certainly this is likely to just be a one off. We had quite a lot if email incoming in our ERPNext system and perhaps only had this happen once in a couple if years.