Pull_from_email_account - error: [Errno 111] Connection refused

I have Cpanel mail
Incoming mail server: mail.domain.com
IMAP and SSL enabled
Outgoing mail server: mail.domain.com
Port: Blank (as it denoted 465).

Here is error log:

{‘retry’: 0, ‘log’: <function log at 0xb5ba15dc>, ‘site’: u’VAA’, ‘event’: u’all’, ‘method_name’: u’pull_from_email_account’, ‘method’: <function pull_from_email_account at 0xb556341c>, ‘user’: u’Administrator’, ‘kwargs’: {‘email_account’: u’Sales’}, ‘async’: True, ‘job_name’: u’pull_from_email_account|Sales’}
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 71, in execute_job
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 699, in pull_from_email_account
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 253, in receive
emails = email_server.get_messages()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 105, in get_messages
if not self.connect():
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 44, in connect
return self.connect_imap()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 52, in connect_imap
self.imap = Timed_IMAP4_SSL(self.settings.host, timeout=frappe.conf.get(“pop_timeout”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 550, in init
self._super.init(self, *args, **kwargs)
File “/usr/lib/python2.7/imaplib.py”, line 1165, in init
IMAP4.init(self, host, port)
File “/usr/lib/python2.7/imaplib.py”, line 172, in init
self.open(host, port)
File “/usr/lib/python2.7/imaplib.py”, line 1176, in open
self.sock = socket.create_connection((host, port))
File “/usr/lib/python2.7/socket.py”, line 571, in create_connection
raise err
error: [Errno 111] Connection refused

1 Like

Probably an issue with a wrong port. Make sure the port that you’re supposed to be connecting to is correct.

I didn’t get an option to mention port for incoming mail and hence I selected IMAP.
For outgoing mail, I left the port blank as I can’t save port 465 with TLS enabled.
All my other emails are going properly through port 465.

Is there a feature to explicitly mention IMAP port

1 Like