Applicable to:
- Plesk Obsidian for Linux
Question
How to enable / manage / verify mail autodiscover functionality in Plesk Obsidian?
Answer
Warning: Outlook 2016/2019/Office 365 supports autodiscover for IMAP/SMTP protocols starting with Plesk Obsidian 18.0.25.
-
Go to Tools & Settings > Mail Server Settings > Settings tab > General options > Enable the Enable mail autodiscover option:
Note: if the option is not visible it means that Plesk Premium Email is installed, which has its own autodiscovery mechanism [BUG] Mail autodiscover option is not visible in Mail Server Settings
-
If Nginx is not installed on the server, go to Tools & Settings > Apache Web server > Enable the proxy_http module > Click OK to apply the changes
-
(Optional) in Plesk > Tools & Settings > Mail Server Settings enter domain name in "Specify a custom domain name for mail autodiscover" field.
-
Manage the mail autodiscover at Domain or Service Plan level:
5.1- Go to Domains > example.com > Mail Settings tab > Enable the option Enable mail autodiscover > Click OK to enable the mail autodiscover for the domain:
5.1- Go to Service Plans > Service Plan Name > Permissions tab > click Show more permissions > Enable the Mail autodiscover management option > Click on Update & Sync to grant permissions to a subscription owner to enable or disable the mail autodiscover:
5.2- Go to Service Plans > Service Plan Name > Mail tab > Enable the option Enable mail autodiscover > Click on Update & Sync to enable the mail autodiscover for all the subscriptions synchronized with the service plan:
6. Install a valid SSL certificate in the domain
7. (Optional) Verify if the mail autodiscover is available for the different mail clients:
7.1- Create XML file customizing the EMailAddress
parameter:
# cat request.xml
<?xml version="1.0" encoding="utf-8"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006">
<Request>
<EMailAddress>jdoe@example.com</EMailAddress>
<AcceptableResponseSchema>
http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006
</AcceptableResponseSchema>
</Request>
</Autodiscover>
7.2- Perform a POST request with the file request.xml
to the URL https://<domain-name>/autodiscover/autodiscover.xml
and the sever will return the following response:
Warning: If the following command fails with certificate subject name
does not match target host name
make sure to install a valid SSL on the domain
# curl -d @request.xml -u jdoe@example.com https://example.com/autodiscover/autodiscover.xml
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
<User>
<DisplayName>jdoe@example.com</DisplayName>
</User>
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>
<Protocol>
<Type>IMAP</Type>
<Server>example.com</Server>
<Port>993</Port>
<DomainRequired>off</DomainRequired>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<LoginName>jdoe@example.com</LoginName>
</Protocol>
<Protocol>
...
</Protocol>
</Account>
</Response>
</Autodiscover>
7.1 - Perform a GET request customizing the emailaddress
parameter to the URL https://<domain-name>/mail/config-v1.1.xml?emailaddress=<email-address>
and the sever will return the following response:
Warning: If the following command fails with certificate subject name
does not match target host name
make sure to install a valid SSL on the domain
# curl https://example.com/mail/config-v1.1.xml?emailaddress=jdoe@example.com
<clientConfig version="1.1">
<emailProvider id="example.com">
<domain>example.com</domain>
<displayName>jdoe@example.com</displayName>
<displayShortName>jdoe@example.com</displayShortName>
<incomingServer type="imap">
<hostname>example.com</hostname>
<port>993</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<username>jdoe@example.com</username>
</incomingServer>
<outgoingServer type="smtp">
<hostname>example.com</hostname>
<port>465</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<username>jdoe@example.com</username>
</outgoingServer>
<incomingServer type="pop3">
<hostname>example.com</hostname>
<port>995</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<username>jdoe@example.com</username>
</incomingServer>
</emailProvider>
</clientConfig>
Note: If DNS is managed externally it will be needed to create SRV records manually there:
CONFIG_TEXT: _imaps._tcp.example.com. SRV mail.example.com.
_pop3s._tcp.example.com. SRV mail.example.com.
_smtps._tcp.example.com. SRV mail.example.com.
Additional information
Check the following table for details on how the feature works depending on the checkboxes enabled/disabled:
Permissions > Mail autodiscover management | Mail > Enable mail autodiscover | For new domains | For existing domains |
---|---|---|---|
Enabled | Disabled |
|
|
Disabled | Enabled |
|
|
Disabled | Disabled |
|
|
Comments
62 comments
Apple Mail autodiscover not working.
What can i do?
Since Plesk seems to configure the root domain as default for autodiscover we have to change it (for now) in the Panel.ini.
Even though "mail.<domain>" is included in DNS Plesk does not include this subdomain in the certificate that is then beeing used for the mailserver. (Posted in the forum about this: https://talk.plesk.com/threads/lets-encrypt-and-assign-the-certificate-to-mail-domain-problems-and-autodiscovery-issues-caused-by-this.360307/)
But "webmail.<domain>" is included in the certificate if enabled and therefore can be used as server address. This is anyways easier for most customers to remember. They can just use the same server name for webmail and mail clients. But again this doesn't seem reliable.
The "fun" fact here is that Plesk doesn't seem to provide the customers certificate when the customer enters webmail.<domain> as mailserver address. So where is the problem here? The certificate was selected to be used for the mailserver but doesn't work on some servers. (Weird)
So what to do?
Add the following lines to the Panel.ini file.
[mail]
clientConfig.incomingServer="webmail.<domain>"
clientConfig.outgoingServer="webmail.<domain>"
clientConfig.incomingProtocols="IMAP over SSL/TLS, POP3 over SSL/TLS"
clientConfig.outgoingProtocols="SMTP over SSL/TLS"
Also we did customize the DNS records somewhat to make this work:
_imaps._tcp.example.com. SRV webmail.example.com.
Weight: 1
Prio: 0
Port: 993
_imap._tcp.example.com. SRV webmail.example.com.
Weight: 1
Prio: 10
Port: 143
_pop3s._tcp.example.com. SRV webmail.example.com.
Weight: 1
Prio: 20
Port: 995
_smtps._tcp.example.com. SRV webmail.example.com.
Weight: 1
Prio: 0
Port: 465
Please sign in to leave a comment.