====== Autoconfig (thunderbird) & Autodiscover (outlook) ======
Thunderbird et Outlook représente une grosse part de marché dans les clients de messagerie. Je m’occupe de plusieurs service de messagerie (pro, asso…) et il est bien commode pour les usagés que « ça tombe en marche » tout seul pour le paramétrage…
A savoir :
Thunderbird chercher les paramètres dans un XML sur http://autoconfig.votredomain.fr/mail/config-v1.1.xml
Outlook cherche l’enregistrement DNS _autodiscover._tcp.votredomain.fr l’url à contacter et ensuite récupère le XML : https://url_donner_dans_le_dns/Autodiscover/Autodiscover.xml
Du coup nous allons rassemblé ces 2 demandes avec un htaccess et un script PHP qui génère le bon format XML fonction de si c’est outlook our thunderbird qui demande…
Pour cela il faut :
Créer un site « autoconfig.votredomain.fr » (ou un alias si vous avez plusieurs site) et faire pointer l’enregistrement DNS bien sûr…
Créer l’enregistrement DNS SRV type :
_autodiscover._tcp.votredomain.fr. 3600 IN SRV 10 10 443 autoconfig.votredomain.fr.
Dans le site autoconfig.votredomain.fr il vous suffit de glisser 2 fichiers à la racine :
Fichier .htaccess contient :
RewriteEngine On
RewriteRule ^Autodiscover/Autodiscover.xml autoconfig-mail.php
RewriteRule ^mail/config-v1.1.xml autoconfig-mail.php
Fichier autoconfig-mail.php contient :
[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i", $domain, $matches)) {
return $matches['domain'];
} else {
return $domain;
}
}
$domain = extract_domain($_SERVER['SERVER_NAME']);
$mailServeur='mail.'.$domain;
if (preg_match('/^\/mail\/config-v1\.1\.xml/', $_SERVER['REQUEST_URI'])) {
header('Content-Type: text/xml');
header('Content-Type: application/xml');
?>
= $domain ?>
= $domain ?>
= $domain ?>
= $mailServeur ?>
143
STARTTLS
%EMAILADDRESS%
password-cleartext
= $mailServeur ?>
587
STARTTLS
%EMAILADDRESS%
password-cleartext
Connexion Webmail
Webmail connexion
Documentation
Generic settings page
(.*?)\<\/EMailAddress\>/", $data, $matches);
//set Content-Type
header('Content-Type: text/xml');
header('Content-Type: application/xml');
echo '';
?>
email
settings
IMAP
= $mailServeur ?>
993
off
off
on
on
POP3
= $mailServeur ?>
995
off
off
on
on
SMTP
= $mailServeur ?>
587
off
off
TLS
on
off
off
===== Sources : =====
[[https://github.com/cfoellmann/ISPC-resources/tree/master/guides/autodiscover]] \\
Générateur : [[https://help.directadmin.com/item.php?id=661]] \\
Pour tester sur outlook : [[https://testconnectivity.microsoft.com]] \\
[[https://www.howto-outlook.com/howto/autodiscoverconfiguration.htm#cname]] \\
[[https://www.awsmonster.com/2019/09/how-to-configure-autodiscover.html]] \\
[[https://github.com/gronke/email-autodiscover]] \\
[[https://github.com/SpicyWeb-de/isp-mailConfig]] \\
\\
[[https://david.mercereau.info/autoconfig-thunderbird-autodiscover-outlook-sur-messagerie-heberge-ispconfig/]]
[[https://autoconfig.thunderbird.net/v1.1/]] \\
[[http://schplurtz.free.fr/wiki/schplurtziel/thunderbird-autoconfig]] \\
[[http://schplurtz.free.fr/wiki/schplurtziel/thunderbird-autoconfig]] \\