It’s really frustrating when you can’t send emails on time.
In most of the cases, senders receive a bounce back message explaining the reason, and most of them are self explaining, but some of them may be unclear.
One such bounce back message is “error: too many hops“.
What does hop mean? Where is the problem? This creates lot of such questions in your mind.
At Bobcares, we help server owners resolve such complex email errors as part of our Server Support Services for web hosts.
Today, we’ll discuss the top 4 reasons for this error and how we fix them.
‘Error: too many hops’ – What this means?
Before we go ahead, let’s get an idea of this error first.
In a normal email delivery mail is sent from the sender to the sender MX, to the receiving MX, and finally to the receiver. But, there may sometimes be additional servers such as Gateway, AntiSpam, etc. between the sender and the recipient.
So, when you send an email over a network, it will pass through several computers before it reaches the destination. Each transfer between these computers is called a hop.
The “error: too many hops” means that there are too many transfers between the sender and the recipient. So, one of the intermediate servers rejects the message to prevent a potential mail loop.
In most cases, our Hosting Engineers analyze the Non Delivery Report (bounce back) to determine the root cause of the issue.
‘Error: too many hops’ – Causes and Fixes
Let’s now see the main reasons for this error and how our Server Support Engineers fix them.
1) Incorrect forwarders for email accounts
This is one of the common mistakes made by server owners. Most often, users set forwarding emails from one mailbox to another and vice versa.
In other words, users have 2 accounts and mistakenly set these 2 accounts forwarding to each other.
That is, message from first account is forwarded to the second account, and second one to the first, and so on.
As a result, this will create an endless loop, and finally message is returned to the sender.
Solution
In these cases, our Support Engineers analyze the email logs and email delivery route to identify email delivery problems.
For example, in cPanel servers, we use the Track Delivery option to check the email delivery route.
In addition to that, we manually check and delete redundant email forwarders for the domains.
2) Incorrect MX records
This usually happens after hosting account migrations. After migration to the new server, it’s important to update the MX records and SMTP routing information for the emails to work.
But, we’ve seen cases where these changes haven’t done properly. As a result, email loops between the old and new servers.
Similarly, duplicate MX records or MX records with same priority can lead to mail delivery loops.
Solution
Here, our Support Engineers first verify the domain’s MX record using the below command.
dig domain.com MX
If we find any MX records with same priority, we change them to a different priority and it should be fine.
Similarly in case of migrations, we confirm that the MX record and SMTP settings of the domain point to the new server.
At Bobcares, our Migration Specialists always keep a pre-migration checklist and post-migration checklist to avoid such problems after migration.
3) Misconfigured email server
During server migration, the mail servers and the mail routing tables may need to be re-configured with new IPs.
Misconfigured mail servers and mail routing tables can keep mails connecting back to the sender, thereby creating an email loop.
For example, server owners mistakenly set the parameter “mydestination = localhost” in the Postfix configuration file. So, Postfix thinks it should only handle mail addressed to the domain localhost.
As a result, external mails are routed on the server itself, and consequently email bounces with “error: too many hops“.
Similarly, in cPanel servers, the /etc/localdomains and /etc/remotedomains are checked to identify whether the emails are hosted locally or remotely. So, a wrong entry in this file can create infinite email loop.
Solution
We check the server error logs, and if any misconfiguration noted in the mail server settings, we’ll immediately correct them.
For example, we check the postfix configuration file and confirm that the destination parameter values are set correctly.
mydestination = $myhostname localhost.$mydomain localhost
Similarly, in cPanel servers, we check whether the domain uses remote MX. If so, we remove the MX entry on the server and add the domain to /etc/remotedomains file.
[Trouble with Misconfigured Mail server? One of our Server Administrators can assist you here. We are available 24/7.]
4) Misconfigured Antispam server
Some web hosts put separate anti spam servers to improve email filtering.
But, it can fail if the outgoing mail route or domain DNS settings are not properly configured. As a result, email loops back between the sender and the Antispam server.
Solution
In this case, our Hosting Engineers analyze the SMTP logs and email headers to understand the origin of the issue.
If we find any configuration problems on the Antispam server such as incorrect SMTP route, DNS settings of the domain, etc. we’ll correct it immediately.
[Need help in fixing this error? Click here to have a Server Expert look at your problem.]
Conclusion
In short, “error: too many hops” can occur due to wrong mail server configuration, improper spam filter settings, and more. Today, we’ve discussed the top 4 reasons for this error and how our Server Support Engineers fix them.
0 Comments