SMTP problem with try exec create_connection func

The problem with this kind of abstraction is the eminently static aspect of this ... For example, SMTP or HTTP could be implemented with these functions.

SMTP problem with try exec create_connection func

This solution has a SMTP server for send a validation mail from registered users.

When execute the sendtestmail function that provides psono server, he return the follow output.

python3 ./psono/manage.py sendtestmail something@something.com
Traceback (most recent call last):
  File "./psono/manage.py", line 17, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/root/psono/restapi/management/commands/sendtestmail.py", line 21, in handle
    html_message=content,
  File "/usr/local/lib/python3.6/site-packages/django/core/mail/__init__.py", line 60, in send_mail
    return mail.send()
  File "/usr/local/lib/python3.6/site-packages/django/core/mail/message.py", line 291, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/usr/local/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 103, in send_messages
    new_conn_created = self.open()
  File "/usr/local/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 63, in open
    self.connection = self.connection_class(self.host, self.port, **connection_params)
  File "/usr/local/lib/python3.6/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/lib/python3.6/smtplib.py", line 336, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/local/lib/python3.6/smtplib.py", line 307, in _get_socket
    self.source_address)
  File "/usr/local/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/local/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
OSError: [Errno 99] Address not available

I understand that do not perform connection with SMTP server but not know exactly where is the problem.

Exists any way for debug this?

Execute netsat comnand only view http server listen, but not see any smtp server.

Thanks for your help!


Click Here to Visit

What's Your Reaction?

like
0
dislike
0
love
0
funny
0
angry
0
sad
0
wow
0