gramps-project / gramps-web-api

A RESTful web API for Gramps
GNU Affero General Public License v3.0
77 stars 40 forks source link

Email send error #543

Closed askurashev closed 2 weeks ago

askurashev commented 2 weeks ago

Hello. My gramps web works fine except sending emails.

My installation:

Gramps 5.2.2
Gramps Web API 2.4.2
Gramps Web Frontend 24.8.0
Gramps QL 0.3.0
locale: en
multi-tree: false
task queue: true

This is log of celery container:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/gramps_webapi/api/util.py", line 497, in send_email
    smtp = smtplib.SMTP_SSL(host=host, port=port, timeout=10)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/smtplib.py", line 1050, in __init__
    SMTP.__init__(self, host, port, local_hostname, timeout,
  File "/usr/lib/python3.11/smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/smtplib.py", line 341, in connect
    self.sock = self._get_socket(host, port, self.timeout)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/smtplib.py", line 1057, in _get_socket
    new_socket = self.context.wrap_socket(new_socket,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 1108, in _create
    self.do_handshake()
  File "/usr/lib/python3.11/ssl.py", line 1379, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:992)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/celery/app/trace.py", line 453, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/gramps_webapi/util/celery.py", line 20, in __call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/gramps_webapi/api/tasks.py", line 79, in send_email_reset_password
    send_email(subject=subject, body=body, to=[email])
  File "/usr/local/lib/python3.11/dist-packages/gramps_webapi/api/util.py", line 516, in send_email
    raise ValueError("Error while trying to send e-mail.")
ValueError: Error while trying to send e-mail.

I use different setthings of tls, mail servers (gmail, own).

DavidMStraub commented 2 weeks ago

Hi,

this is a setup issue. There are some similar threads on Github and in the forum https://gramps.discourse.group/. Converting to a backend discussion.