Alternc  latest
Alternc logiel libre pour l'hébergement
mailautoconfig_thunderbird.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  ----------------------------------------------------------------------
5  LICENSE
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License (GPL)
9  as published by the Free Software Foundation; either version 2
10  of the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  To read the license please visit http://www.gnu.org/copyleft/gpl.html
18  ----------------------------------------------------------------------
19 */
20 
21 /**
22  * Show email autoconfiguration xml data for Thunderbird
23  *
24  * @copyright AlternC-Team 2000-2017 https://alternc.com/
25  */
26 
27 require_once("../class/config_nochk.php");
28 
29 header ("Content-Type:text/xml");
30 
31 /*
32  Test it that way:
33  wget -O - -q http://FQDN/mailautoconfig_thunderbird.php?emailaddress=test@example.tld
34 */
35 
36 if (empty($_GET['emailaddress'])) die(_("Error: Missing GET of emailaddress"));
37 
38 $emailDomain = explode('@', rawurldecode($_GET['emailaddress']));
39 if (empty($emailDomain)) die(_('Error: Empty $emailDomain'));
40 ?>
41 <clientConfig version="1.1">
42 <emailProvider id="<?php echo $L_FQDN ?>">
43 <domain><?php echo $emailDomain[1];?></domain>
44 <displayName><?php echo $L_FQDN ?></displayName>
45 <displayShortName><?php echo $L_FQDN ?></displayShortName>
46  <incomingServer type="imap">
47  <hostname><?php echo $mail->srv_dovecot ;?></hostname>
48  <port>143</port>
49  <socketType>STARTTLS</socketType>
50  <authentication>password-cleartext</authentication>
51  <username>%EMAILADDRESS%</username>
52  </incomingServer>
53  <incomingServer type="pop3">
54  <hostname><?php echo $mail->srv_dovecot;?></hostname>
55  <port>110</port>
56  <socketType>STARTTLS</socketType>
57  <authentication>password-cleartext</authentication>
58  <username>%EMAILADDRESS%</username>
59  </incomingServer>
60  <outgoingServer type="smtp">
61  <hostname><?php echo $mail->srv_postfix;?></hostname>
62  <port>587</port>
63  <socketType>STARTTLS</socketType>
64  <username>%EMAILADDRESS%</username>
65  <authentication>password-cleartext</authentication>
66  </outgoingServer>
67  <outgoingServer type="smtp">
68  <hostname><?php echo $mail->srv_postfix;?></hostname>
69  <port>465</port>
70  <socketType>SSL</socketType>
71  <authentication>password-cleartext</authentication>
72  <username>%EMAILADDRESS%</username>
73  </outgoingServer>
74 </emailProvider>
75 </clientConfig>
if(empty($_GET['emailaddress'])) die(_("Error $emailDomain