Incoming mail bounce back with "Too many hops" message.

archawan

New Member
Jun 24, 2020
6
0
1
24
I have one static IP, with one server running Proxmox VE.

I have installed Virtualmin for mail server and Proxmox Mail Gateway.

I forwarded the port 25 to PMG. I created a transport map in postfix to PMG.

Outgoing mails are fine. Incoming mails are getting bounced back.

Error:

<someone@example.com>: host 192.168.0.142[192.168.0.142] said:
554 5.4.0 Error: too many hops (in reply to end of DATA command)

Mail.log
"Jun 24 11:50:07 hostname postfix/smtp[27951]: warning: 192.168.0.142:26: dane configured with dnssec lookups disabled
Jun 24 11:50:07 hostname postfix/smtp[27951]: 33DB449C12E3: to=<other@other.com>, relay=192.168.0.142[192.168.0.142]:26, delay=0.15, delays=0.11/0.01/0.01/0.03, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 5154380016)
Jun 24 11:52:17 hostname postfix/smtpd[29624]: connect from unknown[192.168.0.142]
Jun 24 11:52:17 hostname postfix/smtpd[29624]: DAC8649C0DF9: client=unknown[192.168.0.142]
Jun 24 11:52:17 hostname postfix/smtpd[29624]: disconnect from unknown[192.168.0.142] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jun 24 11:52:17 hostname postfix/smtp[29636]: warning: 192.168.0.142:26: dane configured with dnssec lookups disabled
Jun 24 11:52:17 hostname postfix/smtp[29636]: DAC8649C0DF9: to=<other@other.com>, orig_to=<other@other.com>, relay=192.168.0.142[192.168.0.142]:26, delay=0.1, delays=0.06/0.01/0.01/0.02, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as E98EC80012)
Jun 24 11:52:18 hostname postfix/smtpd[29624]: connect from unknown[192.168.0.142]
Jun 24 11:52:18 hostname postfix/smtpd[29624]: 1C67649C0DF9: client=unknown[192.168.0.142]
Jun 24 11:52:18 hostname postfix/smtpd[29624]: disconnect from unknown[192.168.0.142] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jun 24 11:52:18 hostname postfix/smtp[29636]: warning: 192.168.0.142:26: dane configured with dnssec lookups disabled
Jun 24 11:52:18 hostname postfix/smtp[29636]: 1C67649C0DF9: to=<other@other.com>, relay=192.168.0.142[192.168.0.142]:26, delay=0.09, delays=0.06/0/0.01/0.02, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 2A03880012)
Jun 24 11:52:18 hostname postfix/smtpd[29624]: connect from unknown[192.168.0.142]
Jun 24 11:52:18 hostname postfix/smtpd[29624]: 3D79C49C0DF9: client=unknown[192.168.0.142]
Jun 24 11:52:18 hostname postfix/smtpd[29624]: disconnect from unknown[192.168.0.142] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jun 24 11:52:18 hostname postfix/smtp[29636]: warning: 192.168.0.142:26: dane configured with dnssec lookups disabled
Jun 24 11:52:18 hostname postfix/smtp[29636]: 3D79C49C0DF9: to=<other@other.com>, relay=192.168.0.142[192.168.0.142]:26, delay=0.08, delays=0.05/0/0.01/0.02, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 47ED980012)
Jun 24 11:52:18 hostname postfix/smtpd[29624]: connect from unknown[192.168.0.142]
Jun 24 11:52:18 hostname postfix/smtpd[29624]: 5C1AB49C0DF9: client=unknown[192.168.0.142]
Jun 24 11:52:18 hostname postfix/smtpd[29624]: disconnect from unknown[192.168.0.142] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jun 24 11:52:18 hostname postfix/smtp[29636]: warning: 192.168.0.142:26: dane configured with dnssec lookups disabled
Jun 24 11:52:18 hostname postfix/smtp[29636]: 5C1AB49C0DF9: to=<other@other.com>, relay=192.168.0.142[192.168.0.142]:26, delay=0.04, delays=0.02/0/0.01/0.02, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 5EF5D80012)
Jun 24 11:52:18 hostname postfix/smtpd[29624]: connect from unknown[192.168.0.142]
Jun 24 11:52:18 hostname postfix/smtpd[29624]: 7243549C0DF9: client=unknown[192.168.0.142]
Jun 24 11:52:18 hostname postfix/smtpd[29624]: disconnect from unknown[192.168.0.142] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5"

This keeps going on. I have filtered out mail.log to only the PMG ip address. I am receiving a lot of spam mails and brute force attack attempts, thus want to shift to PMG.

Please help me out. Thanks.

Edit: Redacted the hostname and mail ids.
 
Last edited:
Please provide such a bounce mail as .eml file. It could be you've configured a loop.
 
Is 192.168.0.21 your mail server? And you do have a loop:
PMG (192.168.0.142) sends to PMG (localhost) which sends to 192.168.0.21 which then again sends to PMG (192.168.0.142).
 
Is 192.168.0.21 your mail server? And you do have a loop:
PMG (192.168.0.142) sends to PMG (localhost) which sends to 192.168.0.21 which then again sends to PMG (192.168.0.142).
How can I solve that?
 
I have done this:
From internet to PMG : Port 25
From PMG to internet : Port 25
And in postfix mail server, a transport layer has been configured as
* smtp:192.168.0.142:26
And in Virtualmin I have allowed port 26 in firewalld.
 

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!