Resolving the ERPNext Email Problems

ERPNext users may encounter unexpected email functionality issues, particularly the error message: "cannot import name 'HeaderWriteError' from 'email.errors'". This article provides a solution.

 · 1 min read

On September 18, 2024, servers with unattended-upgrade enabled began generating error messages related to email operations. This issue has made accessing the Email Queue, Email Account, and Email Domain in Frappe and ERPNext challenging, as these modules are now prone to throwing errors.



Initial investigation points to Python package dependencies. For a technical deep-dive, refer to the following GitHub issue: https://github.com/python/cpython/issues/124170

The Frappe community has also been actively discussing this matter. For additional context, see: https://discuss.frappe.io/t/importerror-cannot-import-name-headerwriteerror-from-email-errors/133350


Resolution Steps:

  1. Execute the following command: bench clear-cache && bench restart
  2. Upon completion, you should regain access to the Email Queue.
  3. To verify the fix, send a test email to confirm functionality.

No comments yet.

Add a comment
Ctrl+Enter to add comment