1 (edited by sam.maeder 2025-05-14 00:43:21)

Topic: All connections stop working after setting up relayhost.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.7.3 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? Downloadable Installer
- Linux/BSD distribution name and version: Ubuntu 24.04.2 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

After initial setup, everything seems to work fine.  But because port 25 is blocked, I cannot successfully send an email.  Once I do the process for setting up smtp relayhost, all connections seem to stop working internally and externally (related to email).  I have Store/Forward from DYNU, my domain provider, that works until adding the relayhost then stops accepting connections.  And I get "not allowed in state 1" when trying to send an email with SoGo.  Roundcube gives an SMTP Error, cannot connect to server.  I've gone round and round trying to troubleshoot, but cannot find the issue, so I'm hoping someone here may see something I'm missing.

NFTables.conf:

#!/usr/sbin/nft -f

flush ruleset

# `inet` applies to both IPv4 and IPv6.
table inet filter {
    chain input {
        type filter hook input priority 0;

        # accept any localhost traffic
        iif lo accept

        # no ping floods:
        ip protocol icmp icmp type echo-request limit rate over 10/second burst 4 packets drop
        ip6 nexthdr icmpv6 icmpv6 type echo-request limit rate over 10/second burst 4 packets drop

        # accept traffic originated from us
        ct state established,related accept

        # accept ICMP & IGMP
        ip6 nexthdr icmpv6 icmpv6 type { echo-request, destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-reduction, nd-router-solicit, nd-router-advert, nd-n>
        ip protocol icmp icmp type { echo-request, destination-unreachable, router-solicitation, router-advertisement, time-exceeded, parameter-problem } accept
        ip protocol igmp accept

        # ssh
        tcp dport 22 accept

        # http, https
        tcp dport 80 accept
        tcp dport 443 accept

        # smtp, submission, smtps
        tcp dport 25 accept
        tcp dport 587 accept
        tcp dport 465 accept

        # pop3, pop3s
        tcp dport 110 accept
        tcp dport 995 accept

        # imap, imaps
        tcp dport 143 accept
        tcp dport 993 accept

        # count and drop any other traffic
        counter drop
    }

    chain output {
        type filter hook output priority 0;
        policy accept;
    }

    chain forward {
        type filter hook forward priority 0;
        policy drop;
    }
}

Attached is the mail.log redacted of personal information.  I will attach the postconf output, main and master.cf files in a reply to this post.

Post's attachments

mail.log 71.49 kb, file has never been downloaded. 

main.cf 12.55 kb, file has never been downloaded. 

master.cf 10.34 kb, file has never been downloaded. 

postconf.txt 44.53 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: All connections stop working after setting up relayhost.

I thought I had to post each file individually.  Took me a couple tries to remember how BBCode forums worked again.  I did get all the files attached for review.

Thank you again for any help in advance.

3

Re: All connections stop working after setting up relayhost.

I am still struggling to figure this out.  Everything seems to be running when I do a systemctl status.  But I don't see Postfix listening on either 25 or 587.

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:4190          0.0.0.0:*               LISTEN      6815/dovecot
tcp        0      0 127.0.0.1:24            0.0.0.0:*               LISTEN      6815/dovecot
tcp        0      0 127.0.0.1:12340         0.0.0.0:*               LISTEN      6815/dovecot
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      835/systemd-resolve
tcp        0      0 127.0.0.54:53           0.0.0.0:*               LISTEN      835/systemd-resolve
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      6815/dovecot
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      6815/dovecot
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1138/nginx: master
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      6815/dovecot
tcp        0      0 127.0.0.1:9999          0.0.0.0:*               LISTEN      875/php-fpm: master
tcp        0      0 127.0.0.1:9998          0.0.0.0:*               LISTEN      6817/amavisd (maste
tcp        0      0 127.0.0.1:10027         0.0.0.0:*               LISTEN      6817/amavisd (maste
tcp        0      0 127.0.0.1:10026         0.0.0.0:*               LISTEN      6817/amavisd (maste
tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      6817/amavisd (maste
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1138/nginx: master
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      6815/dovecot
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      873/memcached
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1157/mariadbd
tcp        0      0 127.0.0.1:7791          0.0.0.0:*               LISTEN      1143/uwsgi
tcp        0      0 127.0.0.1:7790          0.0.0.0:*               LISTEN      1149/uwsgi
tcp        0      0 127.0.0.1:7779          0.0.0.0:*               LISTEN      6867/python3
tcp        0      0 127.0.0.1:7778          0.0.0.0:*               LISTEN      6867/python3
tcp        0      0 127.0.0.1:7777          0.0.0.0:*               LISTEN      6867/python3
tcp        0      0 127.0.0.1:19999         0.0.0.0:*               LISTEN      1132/netdata
tcp        0      0 127.0.0.1:20000         0.0.0.0:*               LISTEN      1567/sogod
tcp        0      0 127.0.0.1:24242         0.0.0.0:*               LISTEN      6815/dovecot
tcp        0      0 127.0.0.1:8125          0.0.0.0:*               LISTEN      1132/netdata
tcp6       0      0 :::993                  :::*                    LISTEN      6815/dovecot
tcp6       0      0 :::995                  :::*                    LISTEN      6815/dovecot
tcp6       0      0 :::443                  :::*                    LISTEN      1138/nginx: master
tcp6       0      0 :::22                   :::*                    LISTEN      1/init
tcp6       0      0 :::110                  :::*                    LISTEN      6815/dovecot
tcp6       0      0 :::80                   :::*                    LISTEN      1138/nginx: master
tcp6       0      0 :::143                  :::*                    LISTEN      6815/dovecot
udp        0      0 127.0.0.1:8125          0.0.0.0:*                           1132/netdata
udp        0      0 127.0.0.54:53           0.0.0.0:*                           835/systemd-resolve
udp        0      0 127.0.0.53:53           0.0.0.0:*                           835/systemd-resolve
udp        0      0 10.0.10.51:68           0.0.0.0:*                           790/systemd-network

postfix.service - Postfix Mail Transport Agent
     Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; preset: enabled)
     Active: active (exited) since Tue 2025-05-20 11:35:41 CDT; 10min ago
       Docs: man:postfix(1)
    Process: 6816 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
    Process: 7166 ExecReload=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 6816 (code=exited, status=0/SUCCESS)
        CPU: 3ms

May 20 11:35:41 mail.[redacted] systemd[1]: Starting postfix.service - Postfix Mail Transport Agent...
May 20 11:35:41 mail.[redacted] systemd[1]: Finished postfix.service - Postfix Mail Transport Agent.
May 20 11:36:11 mail.[redacted] systemd[1]: Reloading postfix.service - Postfix Mail Transport Agent...
May 20 11:36:11 mail.[redacted] systemd[1]: Reloaded postfix.service - Postfix Mail Transport Agent.
May 20 11:38:11 mail.[redacted] systemd[1]: Reloading postfix.service - Postfix Mail Transport Agent...
May 20 11:38:11 mail.[redacted] systemd[1]: Reloaded postfix.service - Postfix Mail Transport Agent.

And no matter what I do, I can't get postfix to say Active just active (exited).

4 (edited by sam.maeder 2025-05-21 01:03:14)

Re: All connections stop working after setting up relayhost.

:facepalm:

sudo postfix start

Not sure why I needed to do that command, but after running it, all is working now. 

:shrug:

So, if you're stuck in a Postfix active(exited) state and don't see Postfix listening, run that command and see if that gets things going for you.  Hopefully this helps someone else.

This can be closed.