unable to connect to localhost at port 10025

May 20, 2017
172
18
58
Netherlands
cyberfusion.nl
Postfix is listening on port 10025:

Code:
root@mxfilter0-1:/usr/share/perl5# netstat -tulpn | grep 25
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      8056/master

But seeing this in mail log:

Code:
Oct 29 11:44:29 mxfilter0-1 pmg-smtp-filter[5196]: unable to connect to localhost at port 10025 at /usr/share/perl5/PMG/Utils.pm line 214.

Any idea?
 
Last edited:
on a hunch - does localhost indeed resolve to 127.0.0.1?
* post your '/etc/hosts'
* post the output of `ping -c 3 localhost`

also you could try restarting postfix and pmg-smtp-filter...

I hope this helps
 
on a hunch - does localhost indeed resolve to 127.0.0.1?
* post your '/etc/hosts'
* post the output of `ping -c 3 localhost`

also you could try restarting postfix and pmg-smtp-filter...

I hope this helps

Hmm. From what I see in the code, a connection to 127.0.0.1 is tried.

This issue started occurring after removing the server's public IPv4 address.

Code:
root@mxfilter0-1:/var/log# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
2a0c:eb00:0:f9:16a:c69:c32:7b5 mxfilter0-0 mxfilter0-0.prorelay.nl
2a0c:eb00:0:f9:82e:e50:8f2:5d7 mxfilter0-1 mxfilter0-1.prorelay.nl


# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

root@mxfilter0-1:/var/log# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 82:ee:50:8f:25:d7 brd ff:ff:ff:ff:ff:ff
    inet6 2a0c:eb00:0:f9:82e:e50:8f2:5d7/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::80ee:50ff:fe8f:25d7/64 scope link
       valid_lft forever preferred_lft forever

root@mxfilter0-1:/var/log# telnet localhost 10025
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mxfilter0-1.prorelay.nl ESMTP ProRelay
^]
telnet> quit
Connection closed.
 
Last edited:
you're right - sorry my mistake...


anything in the logs from postfix around the error from pmg-smtp-filter?

This is the full log:

Code:
Oct 29 13:00:33 mxfilter0-1 postfix/smtpd[23802]: B80CF6244D: client=a52-108.smtp-out.eu-west-1.amazonses.com[54.240.52.108]
Oct 29 13:00:33 mxfilter0-1 pmgpolicy[23443]: SPF says pass
Oct 29 13:00:33 mxfilter0-1 postfix/cleanup[23822]: B80CF6244D: message-id=<stripped@stripped.net>
Oct 29 13:00:33 mxfilter0-1 postfix/qmgr[2590]: B80CF6244D: from=<stripped@stripped.net>, size=12361, nrcpt=2 (queue active)
Oct 29 13:00:33 mxfilter0-1 pmg-smtp-filter[14767]: 2020/10/29-13:00:33 CONNECT TCP Peer: "[127.0.0.1]:43132" Local: "[127.0.0.1]:10024"
Oct 29 13:00:33 mxfilter0-1 pmg-smtp-filter[14767]: 407015F9AAEE1CF271: new mail message-id=<stripped@stripped.net>#012
Oct 29 13:00:34 mxfilter0-1 pmg-smtp-filter[14767]: 407015F9AAEE1CF271: SA score=0/5 time=0.394 bayes=0.00 autolearn=no autolearn_force=no hits=AWL(-0.050),BAYES_00(-1.9),DKIMWL_WL_MED(-0.001),DKIM_SIGNED(0.1),DKIM_VALID(-0.1),DKIM_VALID_AU(-0.1),DKIM_VALID_EF(-0.1),HEADER_FROM_DIFFERENT_DOMAINS(0.25),HTML_MESSAGE(0.001),KAM_NUMSUBJECT(0.5),RCVD_IN_DNSWL_NONE(-0.0001),RCVD_IN_MSPIKE_H4(0.001),RCVD_IN_MSPIKE_WL(0.001),SPF_HELO_NONE(0.001),SPF_PASS(-0.001),T_KAM_HTML_FONT_INVALID(0.01)
Oct 29 13:00:34 mxfilter0-1 pmg-smtp-filter[14767]: unable to connect to localhost at port 10025 at /usr/share/perl5/PMG/Utils.pm line 214.
Oct 29 13:00:34 mxfilter0-1 pmg-smtp-filter[14767]: 407015F9AAEE1CF271: reinject mail to <info@removed.nl> (rule: default-accept) failed
Oct 29 13:00:34 mxfilter0-1 pmg-smtp-filter[14767]: 407015F9AAEE1CF271: reinject mail to <shop@removed.nl> (rule: default-accept) failed
Oct 29 13:00:34 mxfilter0-1 pmg-smtp-filter[14767]: 407015F9AAEE1CF271: processing time: 0.446 seconds (0.394, 0.037, 0)
Oct 29 13:00:34 mxfilter0-1 postfix/lmtp[23551]: B80CF6244D: to=<info@removed.nl>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.66, delays=0.2/0/0/0.45, dsn=4.4.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.4.0 detected undelivered mail to <info@removed.nl> (in reply to end of DATA command))
Oct 29 13:00:34 mxfilter0-1 postfix/lmtp[23551]: B80CF6244D: to=<shop@removed.nl>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.67, delays=0.2/0/0/0.46, dsn=4.4.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.4.0 detected undelivered mail to <shop@removed.nl> (in reply to end of DATA command))

With `-v` specified for the `smtpd` service:

Code:
Oct 29 13:33:39 mxfilter0-1 postfix/smtpd[31111]: connect from localhost.localdomain[127.0.0.1]
Oct 29 13:33:39 mxfilter0-1 postfix/smtpd[31111]: match_list_match: localhost.localdomain: no match
Oct 29 13:33:39 mxfilter0-1 postfix/smtpd[31111]: match_list_match: 127.0.0.1: no match
Oct 29 13:33:39 mxfilter0-1 postfix/smtpd[31111]: match_hostname: smtpd_authorized_xforward_hosts: localhost.localdomain ~? 127.0.0.0/8
Oct 29 13:33:39 mxfilter0-1 postfix/smtpd[31111]: match_hostaddr: smtpd_authorized_xforward_hosts: 127.0.0.1 ~? 127.0.0.0/8
Oct 29 13:33:39 mxfilter0-1 postfix/smtpd[31111]: smtp_stream_setup: maxtime=300 enable_deadline=0
Oct 29 13:33:39 mxfilter0-1 postfix/smtpd[31111]: > localhost.localdomain[127.0.0.1]: 220 mxfilter0-1.prorelay.nl ESMTP ProRelay
Oct 29 13:33:42 mxfilter0-1 postfix/smtpd[31111]: smtp_get: EOF
Oct 29 13:33:42 mxfilter0-1 postfix/smtpd[31111]: lost connection after CONNECT from localhost.localdomain[127.0.0.1]
Oct 29 13:33:42 mxfilter0-1 postfix/smtpd[31111]: disconnect from localhost.localdomain[127.0.0.1] commands=0/0
Oct 29 13:33:42 mxfilter0-1 postfix/smtpd[31111]: name_mask: no_unknown_recipient_checks
Oct 29 13:33:42 mxfilter0-1 postfix/smtpd[31111]: name_mask: no_header_body_checks
Oct 29 13:33:42 mxfilter0-1 postfix/smtpd[31111]: master_notify: status 1
Oct 29 13:33:42 mxfilter0-1 postfix/smtpd[31111]: connection closed

So for some reason, this is failing:

Code:
my $smtp = Net::SMTP->new('127.0.0.1', Port => 10025, Hello => $me);
 
Last edited:
Managed to reproduce the issue here locally (by removing all ipv4 addresses from my test-setup and running ipv6 only)
could you please open a bug-report over at https://bugzilla.proxmox.com (with the details and referencing this thread) - Thanks!

as a mitigation - configuring (any) ipv4 address on the interface should mitigate this:
Code:
ip a a 172.16.0.1/32 dev eno1


This issue started occurring after removing the server's public IPv4 address.

just out of curiosity - how does smtpd then get a connection from
a52-108.smtp-out.eu-west-1.amazonses.com[54.240.52.108]
?
 

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!