Unhandled Email

How can we delete unhandled email

could you please elaborate what you mean by "unhandled email’?

When I am trying to delete an email account its showing unhandled email error

Traceback (most recent call last): 
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", 
line 275, in receive communication = self.insert_communication(msg, args=args) 
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", 
line 386, in insert_communication communication._attachments = email.save_attachments_in_doc(communication) File "/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py", line 522, in save_attachments_in_doc doc.doctype, doc.name, is_private=1) 
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/file_manager.py", 
line 137, in save_file file_data = write_file_method(fname, content, content_type=content_type, is_private=is_private) 
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/file_manager.py", 
line 167, in save_file_on_filesystem fpath = write_file(content, fname, is_private) 
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/file_manager.py", 
line 202, in write_file with open(os.path.join(file_path.encode('utf-8'), fname.encode('utf-8')), 'wb+') as f: 
IOError: [Errno 2] No such file or directory: '//AMS//AMSLogs//pdf//UnitStatement_13120227_2305181426252625.pdf'


Please check whether this email account linked to any of communication

the default inbox is communication

Try replacing that specific e-mail you want to delete with a new one and then delete it.

Did anyone find our any resolution to this?

FYI, I did setup a different default incoming and outgoing mail; still can’t delete the previous email account; neither can do anything about the unhandled mails!

There’s gotta be a way!

I now have this same problem.

  • I have a single “Unhandled Email” that is preventing me from deleting the users email account.

  • I have to delete the users email account so I can then delete the email domain.

  • I have to delete the email domain so that I can reset everything and recreate the domain and all of the user email accounts.

  • All of this because the site_config.json got accidentally deleted and had to be recreated meaning it will self generate a new encryption key which does not work with any of the old email stuff.

So, I MUST be able to delete the Unhandled EMail so I can then delete the users Email Account so I can then delete the Email Domain and start over fresh.

But BEFORE any of this can happen I need a way to delete the “Unhandled Email”

(BTW… there does not appear to be any way to replace the unhandled email with a new one, so please spare me the repeat of bad or incomplete instructions)


It seems I ran into a similar problem. On refresh I always get the message:

I am not able to delete unhandled E-Mail as user or administrator. Any suggestions?

Hi @wojosc,
Seems like a function is missing, which version are you using? Can you check for changes in email_account.py?

we are on v12, latest Version.

What changes should I be looking for?

This seems to be the offending change that possibly broke your system:

Before that, the mentioned function was there…

I have it fixed now. We deleted all unhandled e-mail which didnt’n fix the problem. A
bench update --reset
led to fixing the problem.

Where did it come from?
It might have been caused through trying to use an e-mailaccount for auto-linking where the server of this address would not be able to do this.