Thunderbird:Autoconfiguration

ikasp

Verified User
Joined
Jul 24, 2019
Messages
10
Location
Europé
As many others, we will migrate to DA from cPanel and there are some functions from cPanel that we want to bring to DA.

One of these are autoconfig support for Thunderbird et.al.

Our solution is based on the information given by the mozilla wiki, https://wiki.mozilla.org/Thunderbird:Autoconfiguration.

There are different solutions described there, most use autoconfig.foo.com, but for us it is more convientent to use the base domain name:

Code:
http://example.com/.well-known/autoconfig/mail/config-v1.1.xml
It works with TB do not know about other email clients, only tested with TB.

Hence there are two alternatives to implement this, either directly in the users home directory, as part of the default skeleton, or as an alias. We chosen the latter.

Code:
mkdir -p /var/www/html/.well-known/autoconfig/mail
vi /var/www/html/.well-known/autoconfig/mail/config-v1.1.xml
and put in one of the below:

TLS:

Code:
<?xml version="1.0"?>
<clientConfig version="1.1">
    <emailProvider id="hostingco">
        <domain>%EMAILDOMAIN%</domain>
        <displayName>%EMAILDOMAIN%</displayName>
        <displayShortName>%EMAILDOMAIN%</displayShortName>
        <incomingServer type="imap">
            <hostname>mail.%EMAILDOMAIN%</hostname>
            <port>143</port>
            <socketType>STARTTLS</socketType>
            <authentication>password-cleartext</authentication>
            <username>%EMAILADDRESS%</username>
        </incomingServer>
        <outgoingServer type="smtp">
            <hostname>mail.%EMAILDOMAIN%</hostname>
            <port>587</port>
            <socketType>STARTTLS</socketType>
            <authentication>password-cleartext</authentication>
            <username>%EMAILADDRESS%</username>
        </outgoingServer>
    </emailProvider>
</clientConfig>
SSL:
Code:
<?xml version="1.0"?>
<clientConfig version="1.1">
    <emailProvider id="hostingco">
        <domain>%EMAILDOMAIN%</domain>
        <displayName>%EMAILDOMAIN%</displayName>
        <displayShortName>%EMAILDOMAIN%</displayShortName>
        <incomingServer type="imap">
            <hostname>mail.%EMAILDOMAIN%</hostname>
            <port>993</port>
            <socketType>SSL</socketType>
            <authentication>password-cleartext</authentication>
            <username>%EMAILADDRESS%</username>
        </incomingServer>
        <outgoingServer type="smtp">
            <hostname>mail.%EMAILDOMAIN%</hostname>
            <port>465</port>
            <socketType>SSL</socketType>
            <authentication>password-cleartext</authentication>
            <username>%EMAILADDRESS%</username>
        </outgoingServer>
    </emailProvider>
</clientConfig>
replace "hostingco" with your company url or any text.

Create the alias with custombuild.

Code:
cd /usr/local/directadmin/custombuild
echo "well-known/autoconfig=.well-known/autoconfig” >> custom/webapps.list
./build rewrite_confs
I have tested this with TB, and it works. Other email imap clients I dont know. MS Outlook uses autodiscover, will publish an article about that as well.

Btw, the image verification is a real pita.
 

ikasp

Verified User
Joined
Jul 24, 2019
Messages
10
Location
Europé
Before building the alias, set correct ownership of files.

Code:
cd /var/www/html/.well-known
chown -R webapps.webapps .
 

sparek

Verified User
Joined
Jun 27, 2019
Messages
140
What do iPhones and MacMail use? That would probably be another one that is very popular.
 

ikasp

Verified User
Joined
Jul 24, 2019
Messages
10
Location
Europé
What do iPhones and MacMail use? That would probably be another one that is very popular.
From https://github.com/smartlyway/email-autoconfig-php:

To autoconfigure iOS and macOS default mail application, we must define a mobile configuration profile file (.mobileconfig) with the settings to install in the mail application. This file will be automatically generated for every email passed as input. You must then provide the user this file dynamically via a web form or once generated via email, instant messaging, etc...
 
Top