Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
mailautoconfig_outlook.php
Go to the documentation of this file.
1 <?php
2 require_once("../class/config_nochk.php");
3 
4 # Test it :
5 # wget http://FQDN/mailautoconfig_outlook.php -O - --post-data="test@example.tls" -q
6 
7 // Created by Alesandro Slepcevic - alesandro@plus.hr
8 if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){
9  $postText = file_get_contents('php://input');
10  $string = $postText;
11  $matches = array();
12  $pattern = '/[A-Za-z0-9_-]+@[A-Za-z0-9_-]+.([A-Za-z0-9_-][A-Za-z0-9_]+)/';
13  preg_match($pattern, $string, $matches);
14  $emailDomain = explode('@', $matches[0]);
15 } else {
16  die(_('Missing POST of the mail address'));
17 }
18 
19 header("Content-type: text/xml");
20 echo "<?xml version='1.0' encoding='UTF-8'?> \n";
21 ?>
22 <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
23 <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
24  <Account>
25  <AccountType>email</AccountType>
26  <Action>settings</Action>
27  <Protocol>
28  <Type>IMAP</Type>
29  <Server><?php echo $mail->srv_imaps;?></Server>
30  <Port>993</Port>
31  <LoginName><?php echo $matches[0];?></LoginName>
32  <DomainName><?php echo $emailDomain[1];?></DomainName>
33  <SPA>off</SPA>
34  <SSL>on</SSL>
35  <AuthRequired>on</AuthRequired>
36  </Protocol>
37  <Protocol>
38  <Type>SMTP</Type>
39  <Server><?php echo $mail->srv_smtps;?></Server>
40  <Port>587</Port>
41  <SPA>off</SPA>
42  <SSL>on</SSL>
43  <AuthRequired>on</AuthRequired>
44  <UsePOPAuth>on</UsePOPAuth>
45  <SMTPLast>off</SMTPLast>
46  </Protocol>
47  </Account>
48 </Response>
49 </Autodiscover>