Frequently Asked Question
When a forwarding rule, alias, or filter sends mail back to the same address that originally received it, the mail system creates a delivery loop. After the message is passed around enough times, the mail server stops trying and returns a non-delivery report with a too many hops error.
What “too many hops” means
A “hop” is one delivery step from one mail handling stage to another. For example:
- the message arrives for
user@example.com - an alias or filter forwards it to
user@example.comagain - the server treats that as a new delivery attempt
- the same rule runs again
- the cycle repeats
To protect the server from an endless loop, the mail transport agent counts these re-deliveries. Once the count exceeds its safety limit, it rejects the message and generates a bounce such as:
<code class="language-text">554 5.4.6 Too many hops </code>
or similar wording depending on the MTA.
Why this happens in Virtualmin/Usermin
Virtualmin and Usermin allow several kinds of mail handling rules, including:
- mailbox forwarding
- aliases
- server-side filters
- autoresponders in some cases
These are only interfaces for the underlying mail system. If a rule is configured to deliver to the same recipient again, the underlying MTA still sees that as a loop.
Common examples include:
user@example.comforwarding touser@example.com- an alias for
sales@example.comthat points tosales@example.com - a filter on
info@example.comthat redirects matching mail toinfo@example.com - two addresses forwarding to each other, such as:
a@example.comforwards tob@example.comb@example.comforwards toa@example.com
Why “keep a copy and forward” is different
Forwarding to an external or different internal address is normally fine.
For example:
john@example.comforwards tomanager@example.comsales@example.comforwards tocrm@externaldomain.co.uk
These are valid because the destination is not the same looping recipient.
If the goal is to retain the message in the original mailbox as well, the correct action is usually:
- deliver locally, and
- send a copy elsewhere
It must not re-inject the message to the same local recipient.
How to avoid the problem
Safe configurations
Use one of these approaches:
- deliver mail to the local mailbox only
- forward mail to a different address
- forward mail to multiple different addresses
- use filters to move mail into folders rather than redirecting it back to the same address
- use aliases that expand to real destination mailboxes, not themselves
What the server is protecting against
Mail systems enforce hop and loop detection because a self-referential rule can otherwise cause:
- endless queue growth
- high CPU and disk use
- duplicate messages
- backscatter and unnecessary bounce traffic
- general mail delivery disruption
The too many hops error is therefore a safety mechanism, not a fault in Virtualmin or Usermin themselves.
Summary
A too many hops NDR occurs because forwarding, alias, or filter rules that point back to the original recipient create a mail loop. Virtualmin and Usermin allow the rule to be defined, but the underlying mail server detects that the message is being re-delivered repeatedly and eventually stops it.
The rule of thumb is simple:
- forward to a different destination
- deliver locally if a copy is needed
- never redirect or alias an address to itself
- avoid circular forwarding chains between local addresses
