YoRyan / mailrise

An SMTP gateway for Apprise notifications.
https://mailrise.xyz
MIT License
831 stars 34 forks source link

Compatibility with FreeBSD #124

Open nefh opened 2 months ago

nefh commented 2 months ago

I've tried mailrise on FreeBSD 14.1 and I get following result.:

mailrise -vv /usr/local/etc/mailrise.conf
[2024-06-28 15:36:15] INFO:mailrise.skeleton:Loaded configuration with 1 recipient(s)
[2024-06-28 15:36:15] DEBUG:mailrise.skeleton:Arguments for aiosmtpd: authenticator=Basic(2), auth_required=True, auth_require_tls=False, tls_context=None, ssl_context=None, require_starttls=False
[2024-06-28 15:36:15] DEBUG:asyncio:Using selector: KqueueSelector
Traceback (most recent call last):
  File "/opt/mailrise/bin/mailrise", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/opt/mailrise/mailrise/src/mailrise/skeleton.py", line 171, in run
    main(sys.argv[1:])
  File "/opt/mailrise/mailrise/src/mailrise/skeleton.py", line 147, in main
    controller = makecon(loop=eloop)
                 ^^^^^^^^^^^^^^^^^^^
  File "/opt/mailrise/lib/python3.11/site-packages/aiosmtpd/controller.py", line 417, in __init__
    self._localhost = get_localhost()
                      ^^^^^^^^^^^^^^^
  File "/opt/mailrise/lib/python3.11/site-packages/aiosmtpd/controller.py", line 66, in get_localhost
    with makesock(AF_INET6, SOCK_STREAM) as sock:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 232, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 43] Protocol not supported

The result is the same when I obtain it through pip or compile from source. There was similiar issue already, it seems to be some ipv6 issue:

https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/2LFYF6XJBY5MONAO4U7CLTLWZ6HB6NUC/

nefh commented 2 months ago

Forcing aiosmtpd and pyyaml to specific version seems to solve the problem:

pip install mailrise pyyaml==6.0.1 aiosmtpd==1.4.1

It would be nice if dependencies were corrected.