Thunderbird supports Autoconfigure, as does Outlook, but they use different methods.
I require StartTLS on port 110 - POP3, 143 - IMAP and 587 - SMTP submission, with IMAP having priority over POP3. (IMAP is first in my examples)
Thunderbird
you need the following file accessible at 'http://www.example.com/.well-known/auto ... g-v1.1.xml'
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<clientConfig version="1.1">
<emailProvider id="example.com">
<domain>example.com</domain>
<displayName>eMail by example.com</displayName>
<displayShortName>EXAMPLE</displayShortName>
<incomingServer type="imap">
<hostname>mail.example.com</hostname>
<port>143</port>
<socketType>STARTTLS</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<incomingServer type="pop3">
<hostname>mail.example.com</hostname>
<port>110</port>
<socketType>STARTTLS</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<outgoingServer type="smtp">
<hostname>mail.example.com</hostname>
<port>587</port>
<socketType>STARTTLS</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</outgoingServer>
</emailProvider>
</clientConfig>
(I've used PHP, but you can also use ASP, or Perl or ... to get the input values. PHP was easy for me)
you need the following file accessible at 'http://www.example.com/autodiscover/autodiscover.php'
Code: Select all
<?php
//get raw POST data so we can extract the email address
$data = file_get_contents("php://input");
preg_match("/\<EMailAddress\>(.*?)\<\/EMailAddress\>/", $data, $matches);
//set Content-Type
header("Content-Type: application/xml");
?>
<?php echo '<?xml version="1.0" encoding="utf-8" ?>'; ?>
<!-- info used from the following sites
http://www.virer.net/info/ol-autodiscover/index.html
https://technet.microsoft.com/en-us/library/cc511507.aspx
-->
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>
<Protocol>
<Type>IMAP</Type>
<Server>mail.example.com</Server>
<Port>143</Port>
<DomainRequired>on</DomainRequired>
<LoginName><?php echo $matches[1]; ?></LoginName>
<SPA>off</SPA>
<Encryption>TLS</Encryption>
<AuthRequired>on</AuthRequired>
</Protocol>
<Protocol>
<Type>POP3</Type>
<Server>mail.example.com</Server>
<Port>110</Port>
<DomainRequired>on</DomainRequired>
<LoginName><?php echo $matches[1]; ?></LoginName>
<SPA>off</SPA>
<Encryption>TLS</Encryption>
<AuthRequired>on</AuthRequired>
</Protocol>
<Protocol>
<Type>SMTP</Type>
<Server>mail.example.com</Server>
<Port>587</Port>
<DomainRequired>on</DomainRequired>
<LoginName><?php echo $matches[1]; ?></LoginName>
<SPA>off</SPA>
<Encryption>TLS</Encryption>
<AuthRequired>on</AuthRequired>
</Protocol>
</Account>
</Response>
</Autodiscover>
I use Apache and so rewrite is done with .htaccess (IIS needs a rewrite module added, and rules are generated and tested using the IIS Admin GUI, or a web.config file should be generated)
Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ autodiscover.php [NC,L]