Autoconfiguration

Some clients, such as thunderbird can ask the mail server for proper settings, such as encryption, ports, authentication method and username format. while some of these can be offered thru DNS's SRV fields, some must be entered manually.

There are three standards for automatic configuration of email clients

  • Mozilla's autoconfiguration
  • Microsoft's autodiscovery
  • Apple's MobileClient (?)

Autoconfiguration protocol

First httpd should know correct Content-Type values for xml, add the following to your httpd.conf:

types {
        application/xml         xml
}

Put the following under /var/www/htdocs/mail/config-v1.1.xml:

<?xml version="1.0" encoding="UTF-8"?>

<clientConfig version="1.1">
  <emailProvider id="mail.example.com">
    <domain>example.com</domain>
    <displayName>Example.com email server</displayName>
    <displayShortName>example.com</displayShortName>
    <incomingServer type="imap">
      <hostname>mail.example.com</hostname>
      <port>993</port>
      <socketType>SSL</socketType>
      <authentication>password-cleartext</authentication>
      <username>%EMAILLOCALPART%</username>
    </incomingServer>
    <outgoingServer type="smtp">
      <hostname>mail.example.com</hostname>
      <port>465</port>
      <socketType>SSL</socketType>
      <authentication>password-cleartext</authentication>
      <username>%EMAILLOCALPART%</username>
    </outgoingServer>
    <documentation url="https://example.com/path/to/your/documention">
      <descr lang="en">Email client documention</descr>
    </documentation>
  </emailProvider>
</clientConfig>

If your email usernames are in the form of john@example.com, replace EMAILLOCALPART with EMAILADDRESS, if they are in form of john (for john@example.com account), keep those as they are.