How to Enable FTP in cPanel (WHM): A Step-by-Step Guide FTP (File Transfer Protocol) is…
How to Fix cPanel LMTP Error When Sending Emails Within the Same Domain

Are you experiencing a cPanel LMTP error when sending emails to another email address on the same domain? This is a common email delivery issue on cPanel servers that can prevent messages from reaching their intended recipients.
In most cases, the problem is related to incorrect email routing configuration in cPanel. The server may be attempting to deliver emails locally even though the domain’s actual email service is hosted on an external mail server.
In this guide, we will explain why this error occurs and show you how to fix the cPanel LMTP email delivery error by configuring the domain’s mail routing settings correctly.
What Causes the cPanel LMTP Error?
cPanel uses Exim as its Mail Transfer Agent (MTA) to process and route outgoing emails. When an email is sent, Exim checks the server’s mail routing configuration to determine whether the recipient’s domain should receive emails locally or through a remote mail server.
Two important configuration files control this behavior:
/etc/localdomains– Contains domains configured to receive email locally on the cPanel server./etc/remotedomains– Contains domains configured to receive email through an external mail server.
If a domain is incorrectly listed in /etc/localdomains, the server may attempt local delivery even when the domain’s mailboxes are hosted elsewhere.
This can result in an LMTP delivery failure, particularly when Exim cannot find the intended recipient’s mailbox on the local server.
Common cPanel LMTP Error Messages
You may encounter one of the following errors when sending emails between accounts on the same domain:
LMTP error after end of data:
550 5.1.1 User doesn't exist
Other related errors may include:
- LMTP delivery failed
- 550 5.1.1 Recipient address rejected
- Local delivery failure
- Email routing configuration error
These errors can indicate a problem with local mailbox delivery or domain-level mail routing.
How to Fix the cPanel LMTP Error
The correct solution depends on where your domain’s email service is hosted.
If your email accounts are managed by an external mail provider, such as Google Workspace, Microsoft 365, or another remote email server, you need to configure the domain as a Remote Mail Exchanger in cPanel.
This ensures that Exim routes outgoing emails according to the domain’s MX records instead of attempting local mailbox delivery.
Step 1: Verify Your Domain’s Email Hosting
Before making any changes, confirm where your domain’s email accounts are hosted.
If your email service is hosted externally, check your domain’s MX records to verify that they point to the correct mail provider.
You can also check the current routing configuration in WHM.
Important: Do not change the domain to remote mail routing if its email accounts are hosted on the same cPanel server. Doing so may interrupt local email delivery.
Step 2: Remove the Domain from /etc/localdomains
Log in to your cPanel server using SSH with root privileges.
Open the local domains configuration file:
nano /etc/localdomains
Locate the domain experiencing the LMTP error.
For example:
example.com
Remove the domain from the file if its email service is hosted externally.
Save the changes and exit the editor.
Step 3: Add the Domain to /etc/remotedomains
Next, open the remote domains configuration file:
nano /etc/remotedomains
Add the affected domain on a new line:
example.com
Save the file and exit.
This tells cPanel that the domain’s email should be handled by a remote mail server rather than the local server.
Step 4: Configure Email Routing in WHM
If you prefer using a graphical interface, you can configure the same setting through WHM.
Follow these steps:
- Log in to WHM as root.
- Navigate to Email Routing.
- Search for the domain experiencing the LMTP error.
- Select Remote Mail Exchanger.
- Save the changes.
Depending on your cPanel version, you may also find email-related settings under the Email section of the interface.
Using WHM is generally recommended because cPanel automatically updates the relevant mail routing configuration files.
Step 5: Verify the Mail Routing Configuration
After updating the configuration, verify that the domain is listed in the correct file.
Run the following command:
grep -w example.com /etc/localdomains /etc/remotedomains
For a remotely hosted email domain, the expected output should look like this:
/etc/remotedomains:example.com
The domain should no longer appear in /etc/localdomains.
Step 6: Test Email Delivery
Once the routing configuration has been updated, send a test email from one webmail account to another address on the same domain.
For example:
From: [email protected]
To: [email protected]
If the domain’s email is hosted externally and the MX records are configured correctly, Exim should now route the message to the appropriate remote mail server.
Check the recipient’s inbox and review the Exim mail logs if the delivery still fails.
You can monitor the mail log using:
tail -f /var/log/exim_mainlog
This can help you identify whether the message is being routed locally or sent to the remote mail server.
Alternative Fix: Check the Local Mailbox Configuration
If your domain’s email accounts are hosted on the same cPanel server, changing the domain to Remote Mail Exchanger is not the correct solution.
Instead, investigate the local mailbox configuration.
Possible causes include:
- The recipient email account does not exist.
- The mailbox has reached its storage limit.
- Incorrect mailbox permissions are preventing delivery.
- The domain’s email routing configuration is inconsistent.
- Exim or Dovecot is experiencing a local delivery issue.
You can verify the recipient’s mailbox in cPanel under Email Accounts.
If the mailbox exists and the problem persists, review the Exim logs and investigate the specific LMTP error before making further configuration changes.
Frequently Asked Questions (FAQs)
1. What is an LMTP error in cPanel?
An LMTP error occurs when the mail server encounters a problem while delivering an email through the Local Mail Transfer Protocol. It may be caused by incorrect email routing, a missing mailbox, or a local delivery configuration issue.
2. Why can’t I send emails between accounts on the same domain?
This can happen when cPanel incorrectly routes emails locally or when the recipient’s mailbox is missing or misconfigured. If the domain’s email is hosted externally, incorrect local mail routing may prevent successful delivery.
3. What is the difference between Local Mail Exchanger and Remote Mail Exchanger?
A Local Mail Exchanger handles email delivery directly on the cPanel server. A Remote Mail Exchanger routes email to an external mail server based on the domain’s MX records.
4. Will changing email routing to Remote Mail Exchanger fix the LMTP error?
It can resolve the issue when the domain’s email service is hosted externally but cPanel is incorrectly attempting local delivery. However, it will not fix missing mailboxes or other local delivery problems on a server that hosts the domain’s email accounts.
5. Do I need to restart Exim after changing email routing?
When using WHM’s Email Routing interface, cPanel manages the configuration update. A manual Exim restart is generally unnecessary.
If you manually edit configuration files, use the appropriate cPanel-supported method to update and verify the mail routing configuration rather than relying on a service restart alone.
Conclusion
The cPanel LMTP error when sending emails within the same domain is often caused by incorrect email routing settings.
If your domain’s email accounts are hosted on an external mail server, configuring the domain as a Remote Mail Exchanger can resolve the issue by directing email traffic to the correct destination.
However, if your email accounts are hosted locally on the cPanel server, investigate the recipient mailbox, Exim logs, and local delivery configuration before making any routing changes.
Always verify your email hosting setup before modifying mail routing settings to avoid disrupting existing email services.
