Hey guys,
I have setup a custom email domain on my ERPNext and setup a few email addresses for sending and receiving emails. However, I’m getting these errors in my error logs:
First Error
Error Title: Error
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 732, in append_email_to_sent_folder
email_server.imap.append("Sent", "\\Seen", imaplib.Time2Internaldate(time.time()), message.encode())
AttributeError: 'bytes' object has no attribute 'encode'
Another Error that I get for every email address that I have created:
Second Error
Error Title: Error while connecting to email account Support
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 287, in receive
email_server = self.get_incoming_server(in_receive=True, email_sync_rule=email_sync_rule)
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 173, in get_incoming_server
self.check_email_server_connection(email_server, in_receive)
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 186, in check_email_server_connection
email_server.connect()
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py", line 42, in connect
return self.connect_imap()
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py", line 50, in connect_imap
self.imap = Timed_IMAP4_SSL(self.settings.host, self.settings.incoming_port, timeout=frappe.conf.get("pop_timeout"))
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py", line 561, in __init__
self._super.__init__(self, *args, **kwargs)
File "/opt/bitnami/python/lib/python3.7/imaplib.py", line 1288, in __init__
IMAP4.__init__(self, host, port)
File "/opt/bitnami/python/lib/python3.7/imaplib.py", line 198, in __init__
self.open(host, port)
File "/opt/bitnami/python/lib/python3.7/imaplib.py", line 1301, in open
IMAP4.open(self, host, port)
File "/opt/bitnami/python/lib/python3.7/imaplib.py", line 299, in open
self.sock = self._create_socket()
File "/opt/bitnami/python/lib/python3.7/imaplib.py", line 1293, in _create_socket
server_hostname=self.host)
File "/opt/bitnami/python/lib/python3.7/ssl.py", line 423, in wrap_socket
session=session
File "/opt/bitnami/python/lib/python3.7/ssl.py", line 870, in _create
self.do_handshake()
File "/opt/bitnami/python/lib/python3.7/ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/rq/timeouts.py", line 64, in handle_death_penalty
'({0} seconds)'.format(self._timeout))
rq.timeouts.JobTimeoutException: Task exceeded maximum timeout value (300 seconds)
I have tested these email accounts on IMAP outside of ERPNext and they work fine. Anyone knows what’s causing this?
Thank you.