sawyernutsov
New Pleskian
- Server operating system version
- Ubuntu 22.04
- Plesk version and microupdate number
- Obsidian 18.0.80.8
Hi everyone,
I'm running Plesk Obsidian on a multi-domain hosting server and have been trying to get Plesk's Apple Mail .mobileconfig profiles to use the conventional per-domain mail hostname:
domain-a.example → mail.domain-a.example
domain-b.example → mail.domain-b.example
rather than the bare domain or one common mail hostname shared across every domain.
After quite a bit of digging, I found that this can be achieved by adding the following to panel.ini:
The panel.ini file is typically located at:
If the [mail] section already exists, just add the two clientConfig.* lines beneath it.
The interesting part
What confused me initially is that this isn't surfaced in the Plesk UI, and I couldn't initially find an obvious way to tell Plesk:
"For every domain, use mail.<domain> for the generated Apple Mail profile."
I initially investigated the Mail Autodiscover settings and found the following CLI option:
This appeared to solve the Apple .mobileconfig problem because the generated profile started using the specified mail hostname.
However, this is a completely different mechanism.
Because it is a server-wide custom autodiscover hostname, using it with:
changed the SRV records of unrelated domains on the same Plesk server so that they pointed to the same custom hostname.
For example, instead of:
mail.customer-a.example
and
mail.customer-b.example
they could end up pointing to:
mail.example-a.test
Removing the custom autodiscover hostname afterwards did not automatically restore those existing SRV records.
This is quite an important distinction on a multi-domain/multi-tenant Plesk server.
The solution
After restoring the affected DNS zones to their Plesk defaults and using:
Plesk behaved exactly as I originally wanted.
Existing domains generated Apple Mail profiles using their own:
mail.<domain>
hostname for both incoming and outgoing mail.
I then performed the really useful test: I created a completely new domain.
I didn't make any domain-specific changes.
Plesk automatically generated the new domain's .mobileconfig using:
mail.<new-domain>
for both IMAP and SMTP.
So the per-domain configuration works correctly.
What I think is confusing
There appear to be two very different Plesk mechanisms:
Per-domain client configuration:
This gives:
domain-a → mail.domain-a
domain-b → mail.domain-b
domain-c → mail.domain-c
Server-wide custom autodiscover hostname:
This gives all domains the same autodiscover hostname and can modify existing DNS SRV records.
The distinction wasn't obvious to me when I was trying to solve the Apple Mail .mobileconfig issue.
A couple of notes
The <domain> placeholder is substituted per-domain by Plesk.
mail.<domain> obviously needs to resolve correctly.
The hostname needs an appropriate TLS certificate.
A wildcard certificate such as *.example.com covers mail.example.com.
Existing domains may need their DNS zone reset to apply the configuration, whereas newly created domains appear to pick it up automatically.
My question for Plesk
Is clientConfig.incomingServer="mail.<domain>" / clientConfig.outgoingServer="mail.<domain>" the intended supported solution for a multi-domain Plesk server where every domain should use its own mail.<domain> hostname?
If so, I think this deserves much more prominent documentation.
In particular, I think there should be a very clear distinction between the per-domain clientConfig.* settings and the server-wide custom Mail Autodiscover hostname.
The latter can have significant consequences when used with -reconfigure-dns true, so it would be useful for Plesk to make that distinction explicit.
I spent quite a while investigating the Apple .mobileconfig generation and even went down the wrong path before finding the panel.ini solution.
Hopefully this saves someone else the same headache.
I'm running Plesk Obsidian on a multi-domain hosting server and have been trying to get Plesk's Apple Mail .mobileconfig profiles to use the conventional per-domain mail hostname:
domain-a.example → mail.domain-a.example
domain-b.example → mail.domain-b.example
rather than the bare domain or one common mail hostname shared across every domain.
After quite a bit of digging, I found that this can be achieved by adding the following to panel.ini:
Code:
[mail]
clientConfig.incomingServer="mail.<domain>"
clientConfig.outgoingServer="mail.<domain>"
The panel.ini file is typically located at:
Code:
/usr/local/psa/admin/conf/panel.ini
If the [mail] section already exists, just add the two clientConfig.* lines beneath it.
The interesting part
What confused me initially is that this isn't surfaced in the Plesk UI, and I couldn't initially find an obvious way to tell Plesk:
"For every domain, use mail.<domain> for the generated Apple Mail profile."
I initially investigated the Mail Autodiscover settings and found the following CLI option:
Code:
plesk bin mailserver --set-mail-autodiscover-domain-name <hostname> -reconfigure-dns true
This appeared to solve the Apple .mobileconfig problem because the generated profile started using the specified mail hostname.
However, this is a completely different mechanism.
Because it is a server-wide custom autodiscover hostname, using it with:
Code:
-reconfigure-dns true
changed the SRV records of unrelated domains on the same Plesk server so that they pointed to the same custom hostname.
For example, instead of:
mail.customer-a.example
and
mail.customer-b.example
they could end up pointing to:
mail.example-a.test
Removing the custom autodiscover hostname afterwards did not automatically restore those existing SRV records.
This is quite an important distinction on a multi-domain/multi-tenant Plesk server.
The solution
After restoring the affected DNS zones to their Plesk defaults and using:
Code:
[mail]
clientConfig.incomingServer="mail.<domain>"
clientConfig.outgoingServer="mail.<domain>"
Plesk behaved exactly as I originally wanted.
Existing domains generated Apple Mail profiles using their own:
mail.<domain>
hostname for both incoming and outgoing mail.
I then performed the really useful test: I created a completely new domain.
I didn't make any domain-specific changes.
Plesk automatically generated the new domain's .mobileconfig using:
mail.<new-domain>
for both IMAP and SMTP.
So the per-domain configuration works correctly.
What I think is confusing
There appear to be two very different Plesk mechanisms:
Per-domain client configuration:
Code:
[mail]
clientConfig.incomingServer="mail.<domain>"
clientConfig.outgoingServer="mail.<domain>"
This gives:
domain-a → mail.domain-a
domain-b → mail.domain-b
domain-c → mail.domain-c
Server-wide custom autodiscover hostname:
Code:
plesk bin mailserver --set-mail-autodiscover-domain-name <hostname> -reconfigure-dns true
This gives all domains the same autodiscover hostname and can modify existing DNS SRV records.
The distinction wasn't obvious to me when I was trying to solve the Apple Mail .mobileconfig issue.
A couple of notes
The <domain> placeholder is substituted per-domain by Plesk.
mail.<domain> obviously needs to resolve correctly.
The hostname needs an appropriate TLS certificate.
A wildcard certificate such as *.example.com covers mail.example.com.
Existing domains may need their DNS zone reset to apply the configuration, whereas newly created domains appear to pick it up automatically.
My question for Plesk
Is clientConfig.incomingServer="mail.<domain>" / clientConfig.outgoingServer="mail.<domain>" the intended supported solution for a multi-domain Plesk server where every domain should use its own mail.<domain> hostname?
If so, I think this deserves much more prominent documentation.
In particular, I think there should be a very clear distinction between the per-domain clientConfig.* settings and the server-wide custom Mail Autodiscover hostname.
The latter can have significant consequences when used with -reconfigure-dns true, so it would be useful for Plesk to make that distinction explicit.
I spent quite a while investigating the Apple .mobileconfig generation and even went down the wrong path before finding the panel.ini solution.
Hopefully this saves someone else the same headache.