Error When Deploying Chatmail Relay: test_no_vrfy [port 25 blocked from home ISP]

Hello!

I’m trying to deploy a chatmail relay and am getting very close! I have run into this error message when running scripts/cmdeploy test:

Long Error Message
[gw1] [ 94%] FAILED cmdeploy/src/cmdeploy/tests/online/test_0_login.py::test_no_vrfy

================================================================ FAILURES =================================================================
______________________________________________________________ test_no_vrfy _______________________________________________________________
[gw1] linux -- Python 3.12.3 /home/user/relay/venv/bin/python3

cmfactory = <cmdeploy.tests.plugin.ChatmailACFactory object at 0x71154264d820>
chatmail_config = <chatmaild.config.Config object at 0x711543f30d10>

    def test_no_vrfy(cmfactory, chatmail_config):
        ac = cmfactory.get_online_account()
        addr = ac.get_config("addr")
        domain = chatmail_config.mail_domain

>       s = smtplib.SMTP(domain)
            ^^^^^^^^^^^^^^^^^^^^

cmdeploy/src/cmdeploy/tests/online/test_0_login.py:97:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.12/smtplib.py:255: in __init__
    (code, msg) = self.connect(host, port)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.12/smtplib.py:341: in connect
    self.sock = self._get_socket(host, port, self.timeout)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.12/smtplib.py:312: in _get_socket
    return socket.create_connection((host, port), timeout,
/usr/lib/python3.12/socket.py:852: in create_connection
    raise exceptions[0]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

address = ('chatmail.example.com', 25), timeout = <object object at 0x71154b178aa0>, source_address = None

    def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
                          source_address=None, *, all_errors=False):
        """Connect to *address* and return the socket object.

        Convenience function.  Connect to *address* (a 2-tuple ``(host,
        port)``) and return the socket object.  Passing the optional
        *timeout* parameter will set the timeout on the socket instance
        before attempting to connect.  If no *timeout* is supplied, the
        global default timeout setting returned by :func:`getdefaulttimeout`
        is used.  If *source_address* is set it must be a tuple of (host, port)
        for the socket to bind as a source address before making the connection.
        A host of '' or port 0 tells the OS to use the default. When a connection
        cannot be created, raises the last error if *all_errors* is False,
        and an ExceptionGroup of all errors if *all_errors* is True.
        """

        host, port = address
        exceptions = []
        for res in getaddrinfo(host, port, 0, SOCK_STREAM):
            af, socktype, proto, canonname, sa = res
            sock = None
            try:
                sock = socket(af, socktype, proto)
                if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
                    sock.settimeout(timeout)
                if source_address:
                    sock.bind(source_address)
>               sock.connect(sa)
E               OSError: [Errno 101] Network is unreachable

/usr/lib/python3.12/socket.py:837: OSError
=========================================================== slowest 5 durations ===========================================================
138.29s call     src/cmdeploy/tests/online/test_0_login.py::test_no_vrfy
13.51s call     src/cmdeploy/tests/online/test_1_basic.py::test_expunged
13.04s call     src/cmdeploy/tests/online/test_1_basic.py::test_exceed_rate_limit
11.55s call     src/cmdeploy/tests/online/test_0_login.py::test_concurrent_logins_same_account
10.05s call     src/cmdeploy/tests/online/test_1_basic.py::test_reject_missing_dkim[fake@testrun.org]
========================================================= short test summary info =========================================================
SKIPPED [1] cmdeploy/src/cmdeploy/tests/online/test_1_basic.py:126: set CHATMAIL_DOMAIN2 to a second chatmail server
SKIPPED [2] cmdeploy/src/cmdeploy/tests/online/test_1_basic.py:178: port 25 not reachable for chatmail.example.com
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================== 1 failed, 69 passed, 3 skipped in 153.73s (0:02:33) ===========================================

I notice that it says port 25 not reachable for chatmail.example.com but I have checked that port 25 is open on the firewall and have also tried disabling the firewall, both with the same result.

My VPS host has allowed for outbound traffic on port 25 and 465 and I’m running this on a fresh Debian 12 deployment.

Does anyone have any suggestions for other troubleshooting steps or solutions?

Thank you!

Maybe your ISP at home from where you deploy the server does not allow outbound connections on port 25? You can try ncat chat.example.com or something like this and see if you get the banner.

You can also just test if the relay is working, and ignore this test if everything works fine and federation with other relay works. This one is most likely to be a false positive since it requires connections from your residental connection to relay port 25 to work. Normally port 25 is only used between relays.

That appears to have been it! I installed the Delta Chat app and was able to create an account on my hosted relay.

Thanks for your help!