Dev License: This installation of WHMCS is running under a Development License and is not authorized to be used for production use. Please report any cases of abuse to abuse@whmcs.com

How to Set Up Email Routing in cPanel Print

  • 0

Configure how your domain handles incoming email - whether to deliver locally, forward to external servers, or reject messages entirely.

What is Email Routing?

Email routing determines how our servers handles incoming email for your domains. Options include:
Local Mail Exchanger: Deliver email to local accounts
Backup Mail Exchanger: Accept mail when primary server is down
Remote Mail Exchanger: Forward all email to external server
Refuse: Reject all incoming email

Accessing Email Routing

1. Log into cPanel
2. Find "Email Routing" in the Email section
3. Click on "Email Routing"
4. Select the domain to configure
5. Choose the appropriate routing option

Email Routing Options Explained

Local Mail Exchanger (Default):
• Email delivered to local cPanel email accounts
• Best for hosting email on our servers
• Allows creation of email accounts in cPanel
• Most common configuration

Backup Mail Exchanger:
• Server accepts email when primary server is unavailable
• Holds email until primary server is back online
• Used for redundancy and reliability
• Requires lower priority MX record

Remote Mail Exchanger:
• All email forwarded to external email service
• Contact support if you need to integrate with external email services
• Cannot create local email accounts
• Requires external email service setup

Refuse:
• Reject all incoming email for the domain
• Use when domain doesn't need email service
• Saves server resources
• Returns bounce messages to senders

Setting Up Local Mail Exchanger

1. Select "Local Mail Exchanger"
2. Click "Change" to apply
3. Create email accounts in cPanel
4. Configure MX records to point to our servers

Required MX Record:
• Priority: 0
• Destination: mail.yourdomain.com
• Or use our servers's hostname

Configuring Remote Mail Exchanger

For Google Workspace:
1. Select "Remote Mail Exchanger"
2. Set up MX records for Google:
• Priority 1: aspmx.l.google.com
• Priority 5: alt1.aspmx.l.google.com
• Priority 5: alt2.aspmx.l.google.com
• Priority 10: alt3.aspmx.l.google.com
• Priority 10: alt4.aspmx.l.google.com

For Microsoft 365:
1. Select "Remote Mail Exchanger"
2. Set MX record to:
• Priority 0: yourdomain-com.mail.protection.outlook.com

Backup Mail Exchanger Setup

1. Configure primary email server elsewhere
2. Set your cPanel server as backup
3. Select "Backup Mail Exchanger"
4. Configure MX records:

MX Record Configuration:
• Priority 10: primary-mail-server.com
• Priority 20: your-cpanel-server.com (backup)

Email Routing and DNS

MX Records Must Match Routing:
• Local routing requires MX pointing to our servers
• Remote routing requires MX pointing to external service
• Backup routing requires higher priority MX record
• Mismatched settings cause email delivery issues

Testing Email Routing

Verify Configuration:
1. Send test email to your domain
2. Check email delivery location
3. Verify MX records using online tools
4. Test from external email services

MX Record Testing Tools:
• mxtoolbox.com - MX record lookup
• whatsmydns.net - Global DNS propagation
• mail-tester.com - Email deliverability testing

Common Email Routing Scenarios

Migrating to External Email:
1. Set up external email service (Google, Microsoft)
2. Change routing to "Remote Mail Exchanger"
3. Update MX records to point to new service
4. Test email delivery thoroughly

Hybrid Email Setup:
• Some addresses hosted locally
• Others forwarded to external services
• Use email forwarders for specific addresses
• Keep local routing for flexibility

Temporary Email Disable:
1. Set routing to "Refuse"
2. All email bounces back to senders
3. Use during maintenance or migration
4. Remember to re-enable when ready

Troubleshooting Email Routing

  • Email not delivered: Check routing matches MX records
  • Bounced emails: Verify routing is not set to "Refuse"
  • Duplicate emails: Check for conflicting MX records
  • Delayed delivery: Verify backup routing configuration
  • External service issues: Confirm remote routing setup

Email Routing Best Practices

  • Match routing to MX records: Ensure DNS and routing align
  • Test thoroughly: Verify email delivery after changes
  • Plan migrations: Use backup routing during transitions
  • Monitor delivery: Watch for routing-related issues
  • Document settings: Keep record of routing configurations

Was this answer helpful?

« Back

Powered by WHMCompleteSolution