• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Question Force same domain emails to use MX records

jenjohn

New Pleskian
Server operating system version
Ubuntu 22.04..4
Plesk version and microupdate number
18.0.63 Update #4
I have setup MX records to use both Google SMTP server [1st priority] and Plesk Mail Server. I have a few email accounts that use Google Workspace and a quite a few other email accounts that use Plesk Mail server. The setup works perfectly - email sent to the user at Google SMTP server is received. Other email accounts are able to use Plesk email server to receive and send emails.

However, biggest caveat is when a Plesk email server user sends to a Google SMTP server user, it does NOT go to Google SMTP server. It is received locally i.e. Plesk does not lookup MX records to recognize that this should be sent to Google SMTP server.

Is there a setting where you can force Plesk to lookup MX records everytime irrespective of sender/receiver being in the same domain?
 
I tried that but it disabled ALL emails to Plesk email accounts. Please note that I have email accounts in Plesk AND in Google Workspace/Gmail. I cannot disable Plesk email completely, they are live accounts. I will need Plesk to check MX records even if I am sending to the same domain.
 
Yes, I have a domain that has some mailboxes in Plesk and some in Google. So, cannot really disable emails in Plesk.
 
This use case is currently not supported by Plesk. When the email service is enabled for a domain in Plesk, email is always delivered locally rather than routed externally via MX records.
 
Last edited:
Unfortunately, this is how the mail service works.

The email addresses should be created on only one system. Each system considers all the email addresses to be hosted on that system.

You could use a subdomain with Google mail and configure the Golgle hosted addresses to check/use the corresponding Plesk hosted email addresses.
 
This feature request should be considered by Plesk. It doesn't make sense to pay Google for 25 email accounts when only 2 or 3 actually need the Google Workspace features. Google themselves encourage this split delivery feature...


Raul, can you give more details on your approach? TIA.
 
This is also causing another unintended effect. The gmail users have created an alias and some groups. Unfortunately, the email users in the local server CANNOT send to these alias and groups because local email server FIRST checks the existence of alias/groups and it cannot find it and throws an error. All of this can be avoided if Plesk follows its own rules - use MX records to route the email instead of sending it internally first!!
 
Plesk follows its own rules - use MX records to route the email instead of sending it internally first!
Nobody and nothing does and should ever prioritize email routing based on MX over local authority!
That would break all rules and regulation regarding email delivery.

"split" domain scenarios can be achieved with manual re-routing rules for unknown addresses (i.e. "catchall" box) or the use of subdomains.
But then again, you may get this up and running, just to then get f**ked over by DKIM and DMARC
 
Google themselves encourage this split delivery feature...
... by violating quite a bunch of standards. This can only work if the google mail server is the first to receive the mails, and then relays all it doesn't know to your internal server. It will definitely break such things as fallback MX.
 
I’m experiencing the same issue and I’m surprised that Plesk still doesn't offer a clean solution for this.

In cPanel/WHM, this problem is addressed with the Email Routing setting. You can choose one of the following options per domain:

  • Automatically configure email routing: cPanel checks the MX records in the local DNS zone to determine whether mail should be routed locally or remotely.
  • Local Mail Exchanger: When you select this setting, the server will always accept mail for the domain. The system will deliver mail to the local mailbox.
  • Backup Mail Exchanger: When you select this setting, the server will function as a backup mail exchanger. The system will hold mail for the domain until a lower-numbered mail exchanger becomes available.
  • Remote Mail Exchanger: When you select this setting, the server will not accept mail for the domain. The system will send all mail for the domain to the lowest-numbered mail exchanger.
This allows for hybrid setups: you can still have local mailboxes, but force same-domain messages to follow external MX records by selecting Remote Mail Exchanger.

More info: Email Routing | cPanel & WHM Documentation

Is there a feature request for something similar?
 
In Plesk you can have the mail service enabled or disabled for a given domain. The 3rd option will disable the mail service and will delete the local email adresses allong with the already received emails.

Back to the cPanel solution, the backup MX will accept emails and and will route them to the MX server with the lowest weight. It won't allow you to have a split setup with some addresses hosted on cPanel while others with the remote system.

In practice I don't know how "Automatically configure email routing" will work.
 
Back
Top