Mail autoconfiguration for Thunderbird and Outlook

  • With this howto mail settings get automatically configured if a user sets up an email account in Thunderbird or Outlook 2007+.


    If the user has the email account [email protected], the mail clients look in different locations:
    Thunderbird looks for settings in:
    http://autoconfig.emaildomain.ch/mail/config-v1.1.xml
    http://emaildomain.ch/.well-kn…nfig/mail/config-v1.1.xml
    Outlook looks for settings in:
    https://autodiscover.emaildoma…discover/autodiscover.xml
    https://emaildomain.ch/autodiscover/autodiscover.xml


    Since I have a DNS wildcard for every domain to the server I use autoconfig.*/autodiscover.*.


    1. edit 00_master_ssl.conf (or whatever your first SSL virtual host is)
    Add this alias in the "SECTION custom" block:

    Code
    1. Alias /autodiscover/autodiscover.xml /var/www/imscp/gui/public/autodiscover/autodiscover.php


    2. Put the files autodiscover/autodiscover.php and mail/config-v1.1.xml (see attachment) in the imscp public folder (or to the htdocs folder from the first virtualhost):
    /var/www/imscp/gui/public/autodiscover/autodiscover.php
    /var/www/imscp/gui/public/mail/config-v1.1.xml
    And adjust them to your needs. (I configured TLS and mail.emaildomain.ch with IMAP/SMTP)


    3. reload apache:
    service apache2 reload


    4. done ;)



    [size=large]You need to do this howto every time you update imscp!
    [/size]


    Notes:
    - Both Thunderbird and Outlook display a certificate warning for the SMTP/IMAP domain, since there is probably no valid certificate for mail.emaildomain.ch. You can also use admin.yourdomain.ch as IMAP/SMTP server if you have a valid SSL certificate for it.
    - Outlook also shows a SSL warning for autodiscover.emaildomain.ch
    - You can also configure POP3 instead of IMAP, see the documentation for the correct settings.
    - You can also setup a seperate vhost with "Serveralias autoconfig.* autodiscover.*" and PHP configured. This one wouldn't be deleted on imscp updates but needs a bit tinkering.



    Documentation:
    https://developer.mozilla.org/…rbird%2FAutoconfiguration
    http://technet.microsoft.com/e…507%28v=office.14%29.aspx
    (The TLS option is undocumented for Outlook, I found it somewhere on the internet...)

    Files

    Edited once, last by Jadawin ().

  • Since I have a DNS wildcard for every domain to the server I use autoconfig.*/autodiscover.*.


    I had issues with a customer who had a similar config, as the TLS certs won't match the URL, unless you have a wildcard cert.


  • Nice feature.. But i think it is better to use a plugin for your solution.
    So you don't need to change the templates


    I have my own git repo for changes like this.
    But if I'm motivated enough some day I will do the work and would also do a suitable UI with some options... (configuring a configuration for autoconfiguration to configure a mail account in a mail client, yay xD)



    I had issues with a customer who had a similar config, as the TLS certs won't match the URL, unless you have a wildcard cert.


    Then you can go with the domain, Outlook looks also in http://domain.ch/autodiscover/autodiscover.xml

  • Very interesting stuff, I will adopt part of it, I guess I'll prepare a catc-all site for all my domains, and create the dns entries for the domains to point there.


    A pointer to more information at microsoft. One interesting thing is that you can allow both imap+pop3 while preferring one of them (IMAP users tend to fillup the server space)
    http://technet.microsoft.com/en-us/library/cc511507.aspx

  • Any fixes for last control panel ?
    php is not allowed in /var/www/virtual/default,
    so you can not parse config for outlook express.
    Thunderbird works like a charm.