Try ERPNext Buy Support Partners Foundation

Invalid Outgoing Mail Server or Port?

Hi All,

Initially My mail server is working fine, from last two days it is showing the following error

Traceback (innermost last):

File “/home/frappe/frappe-bench/apps/frappe/frappe/widgets/form/save.py”, line 18, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 171, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 415, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 400, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 478, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 461, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 394, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.py”, line 29, in validate
sess = smtpserver.sess
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/email_lib/smtp.py”, line 82, in sess
cint(self.port) or None)
File “/usr/lib/python2.7/smtplib.py”, line 249, in init
(code, msg) = self.connect(host, port)
File “/usr/lib/python2.7/smtplib.py”, line 309, in connect
self.sock = self._get_socket(host, port, self.timeout)
File “/usr/lib/python2.7/smtplib.py”, line 284, in _get_socket
return socket.create_connection((port, host), timeout)
File “/usr/lib/python2.7/socket.py”, line 571, in create_connection
raise err
error: [Errno 111] Connection refused

Traceback (innermost last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 49, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 66, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 526, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/widgets/form/save.py”, line 18, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 171, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 415, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 400, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 478, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 461, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 394, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.py”, line 29, in validate
sess = smtpserver.sess
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/email_lib/smtp.py”, line 82, in sess
cint(self.port) or None)
File “/usr/lib/python2.7/smtplib.py”, line 249, in init
(code, msg) = self.connect(host, port)
File “/usr/lib/python2.7/smtplib.py”, line 309, in connect
self.sock = self._get_socket(host, port, self.timeout)
File “/usr/lib/python2.7/smtplib.py”, line 284, in _get_socket
return socket.create_connection((port, host), timeout)
File “/usr/lib/python2.7/socket.py”, line 571, in create_connection
raise err
error: [Errno 111] Connection refused

Please help me to solve this

Regards,
rahul

1 Like

Can you test it using telnet ?

http://www.port25.com/how-to-check-an-smtp-connection-with-a-manual-telnet-session-2/

I am having this I just spun up a ubuntu 14.04 virtual machine, and ran the installer script. i can log in and got incoming emails working but the outgoing server won’t work… yet I have the virtual box erpnext server going and it can connect just fine to my email server…

exact same issue at my servers.
Were you ever able to solve this?

Facing same issue, not sure how to resolve this.
Any other thread where this issue is resolved as in I am not able to set passwords for the users. Whenever i try that, It gives me an error.