Error adding email accounts

Hello,

I am trying to add email accounts, but getting following error:
Could you please show me how to fix it?

Thanks a lot.

Traceback (innermost last):
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 247, in save
self.run_before_save_methods()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 627, in run_before_save_methods
self.run_method(“validate”)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 588, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 750, in composer
return composed(self, method, *args, **kwargs)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 733, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 582, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 56, in validate
self.get_server()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 119, in get_server
email_server.connect()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/receive.py”, line 40, in connect
return self.connect_imap()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/receive.py”, line 48, in connect_imap
self.imap = Timed_IMAP4_SSL(self.settings.host, timeout=frappe.conf.get(“pop_timeout”))
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/receive.py”, line 400, 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 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known

Traceback (innermost last):
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/app.py”, line 57, in application
response = frappe.handler.handle()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/init.py”, line 808, in call
return fn(*args, **newargs)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 247, in save
self.run_before_save_methods()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 627, in run_before_save_methods
self.run_method(“validate”)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 588, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 750, in composer
return composed(self, method, *args, **kwargs)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 733, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 582, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 56, in validate
self.get_server()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 119, in get_server
email_server.connect()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/receive.py”, line 40, in connect
return self.connect_imap()
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/receive.py”, line 48, in connect_imap
self.imap = Timed_IMAP4_SSL(self.settings.host, timeout=frappe.conf.get(“pop_timeout”))
File “/var/service/www/nginx/marketsimple.com/frappe-bench/apps/frappe/frappe/email/receive.py”, line 400, 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 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):

As the error on the top says, it seems like you might have entered an invalid mail server. Can you have a look at the mail servers for your email?

1 Like

Thanks to @vjFaLk

That’s weird, cause i have double checked and see the server info is correct.
I am using IMAP connection for setting, so i left the “Service” blank.

Service as blank is completely fine (Unless you’re using one the services in the list). Can you use the same settings in a different email client like, “Outlook” and see if it works fine? Check if your mail service has SSL or not, and check the ports being used accordingly.

1 Like

@vjFaLk

I can get it works by using IP address of mail server, but when i enter the domain name, ex: smtp.marketsimple.com or imap.marketsimple.com, it doesn’t work.

Could it be a bug?

That’s very odd. However, that can’t be an issue on our end, because domains just point to IP addresses. There could be something wrong with the domain configuration.

1 Like

Yeah, i have no idea why it couldn’t work with domain name mail server info.
I am using same setting on my mail client, of course not using IP address.

Are these new mail servers? Have you recently changed your domain? Maybe it’s because of DNS prorogation.

@vjFaLk

No, it’s not new.
And i didn’t adjust DNS recently.

@vjFaLk

Confirm. There was a DNS issue. After fixing it, it works correctly.
Thanks a lot :slight_smile:

Ah, that’s a relief! Weird issues like these keep me up at night, hah!

1 Like

Thanks @vjFaLk

1 Like

No problem :slight_smile: