Integrating Email in ERPNext 13 - [Errno 99] Cannot assign requested address

Hi Guys,

I’m looking into implementing email support into my ERPNext (running on Frappe Cloud) instance again after changing our web server. However now I’m not able to establish a new connection no matter what server I enter (I tried 2 completely different servers, one is our own root server the other one was our credentials for our Mailjet Account).

According to what I found on Github and the forums this behaviour is due to connection restrictions on the server configuration, but the Frappe Cloud Support told me that this is not an hosting issue, but instead telling me that our mail server is misconfigured. Which I honestly don’t understand why that should be the case. Our own web server might be misconfigured, but the Server from Mailjet surely not.

Here’s the traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/email/doctype/email_domain/email_domain.py", line 86, in validate
    (self.smtp_server or "").encode("utf-8"), cint(self.smtp_port) or None
  File "/usr/lib/python3.7/smtplib.py", line 1036, in __init__
    source_address)
  File "/usr/lib/python3.7/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python3.7/smtplib.py", line 336, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python3.7/smtplib.py", line 1042, in _get_socket
    self.source_address)
  File "/usr/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 38, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 76, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1457, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 24, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 310, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 347, in _save
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1052, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 941, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1261, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1243, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 938, in fn
    return method_object(*args, **kwargs)
  File "apps/frappe/frappe/email/doctype/email_domain/email_domain.py", line 104, in validate
    msg='Error connecting SMTP "{host}": {e}'.format(host=self.smtp_server, e=e),
  File "apps/frappe/frappe/__init__.py", line 511, in throw
    as_list=as_list,
  File "apps/frappe/frappe/__init__.py", line 479, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 434, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.ValidationError: Error connecting SMTP "redacted": [Errno 99] Cannot assign requested address

Anybody an idea?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.