postfwd - warning: problem talking to server 127.0.0.1:10045: Connection timed out

Mar 26, 2023
65
10
8
Hi all.

I've installed postfwd to add some needed functionality (such as limiting senders to X emails per hour and queueing the rest, etc.) however, postfix cannot connect to the postfwd service.

I know its not technically a PMG issue, but, does anyone have any ideas on this one?

I've install postfwd like so: https://github.com/postfwd/postfwd

Here are the needed files:

The systemd service:
/etc/systemd/system/postfwd3.service

Code:
[Unit]
Description=Postfix firewall daemon

[Service]
Type=forking
ExecStart=/usr/local/bin/postfwd3 --summary=3600 --cache=600 \
    --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 \
    --cleanup-rates=1200 --daemon --file=/etc/postfwd/postfwd.cf \
    --interface=127.0.0.1 --port=10045 --umask=112 \
    --pidfile=/var/run/postfwd.pid --logname=postfwd --user=postfwd \
    --group=postfwd

ExecStop=/usr/local/bin/postfwd3 --file=/etc/postfwd/postfwd.cf \
    --pidfile=/var/run/postfwd.pid --kill

ExecReload=/usr/local/bin/postfwd3 --file=/etc/postfwd/postfwd.cf \
    --pidfile=/var/run/postfwd.pid --reload

[Install]
WantedBy=multi-user.target

The service is running:
systemctl status postfwd3

Code:
# systemctl status postfwd3
● postfwd3.service - Postfix firewall daemon
     Loaded: loaded (/etc/systemd/system/postfwd3.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-05-27 16:23:50 BST; 44min ago
    Process: 14828 ExecReload=/usr/local/bin/postfwd3 --file=/etc/postfwd/postfwd.cf --pidfile=/var/run/postfwd.pid --reload (code=exited, status=0/SUCCESS)
   Main PID: 11649 (/usr/local/bin/)
      Tasks: 2 (limit: 38432)
     Memory: 27.3M
        CPU: 937ms
     CGroup: /system.slice/postfwd3.service
             ├─11649 /usr/local/bin/postfwd3 --summary=3600 --cache=600 --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 --cleanup-rates=1200 --daemon --file=/etc/postfwd/postfwd.cf --interface=127.0.0.1 --port=10>
             └─11650  postfwd::policy

The service is bound to the port:
netstat -tpln|grep 10045

Code:
root@mailgate1:~# netstat -tpln|grep 10045
tcp        0      0 127.0.0.1:10045         0.0.0.0:*               LISTEN      11650/ postfwd::pol

The rules:
/etc/postfwd/postfwd.cf

Code:
#
# Sample ruleset for postfwd
#


# default: log the request and finish
id=LIMIT_PER_HOUR
    action=rate(client_address, 500, 3600, HOLD)
    action=rate(sender, 500, 3600, HOLD)

The postfix integration:
/etc/pmg/templates/main.cf.in

Code:
smtpd_recipient_restrictions =
        permit_mynetworks
        reject_unauth_destination
       check_policy_service inet:127.0.0.1:10045
        reject_non_fqdn_recipient
        check_recipient_access  regexp:/etc/postfix/rcptaccess
[%- IF postfix.usepolicy %] check_sender_access  regexp:/etc/postfix/senderaccess[% END %]
[%- IF postfix.usepolicy %] check_client_access  cidr:/etc/postfix/clientaccess[% END %]
[%- IF postfix.usepolicy %] check_policy_service inet:127.0.0.1:10022[% END %]
[%- IF pmg.mail.verifyreceivers %] reject_unknown_recipient_domain[% END %]
[%- IF pmg.mail.verifyreceivers %] reject_unverified_recipient[% END %]

But, I keep seeing this timeout in the syslog:

Code:
postfix/smtpd[17494]: warning: problem talking to server 127.0.0.1:10045: Connection timed out
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!