initial commit of file from CVS for smeserver-autodiscover on Sat Sep 7 20:08:09 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:08:09 +10:00
parent 9379997240
commit d6803694bc
35 changed files with 403 additions and 2 deletions

View File

@@ -0,0 +1,4 @@
<User>
<DisplayName><?php echo $_SERVER['SERVER_NAME'] . " Emails"; ?></DisplayName>
</User>

View File

@@ -0,0 +1,3 @@
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>

View File

@@ -0,0 +1,16 @@
{
return "" unless $imaps{'status'} eq "enabled";
$OUT=<<'string_ending_delimiter';
<Protocol>
<Type>IMAP</Type>
<Server><?php echo $_SERVER['SERVER_NAME']; ?></Server>
<Port>993</Port>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<?php echo $LoginName; ?>
</Protocol>
string_ending_delimiter
}

View File

@@ -0,0 +1,16 @@
{
return "" if $imaps{'status'} eq "enabled";
return "" unless $pop3s{'status'} eq "enabled";
$OUT=<<'string_ending_delimiter';
<Protocol>
<Type>POP3</Type>
<Server><?php echo $_SERVER['SERVER_NAME']; ?></Server>
<Port>995</Port>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<?php echo $LoginName; ?>
</Protocol>
string_ending_delimiter
}

View File

@@ -0,0 +1,30 @@
{
$OUT=<<'string_ending_delimiter';
<Protocol>
<Type>SMTP</Type>
<Server><?php echo $_SERVER['SERVER_NAME']; ?></Server>
<Port>25</Port>
<SPA>off</SPA>
<Encryption>TLS</Encryption>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<?php echo $LoginName; ?>
</Protocol>
string_ending_delimiter
#if we start support for port 587 submisison we would need to alter this
return $OUT unless $sqpsmtpd{'status'} eq "enabled";
$OUT=<<'string_ending_delimiter';
<Protocol>
<Type>SMTP</Type>
<Server><?php echo $_SERVER['SERVER_NAME']; ?></Server>
<Port>465</Port>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<?php echo $LoginName; ?>
</Protocol>
string_ending_delimiter
}

View File

@@ -0,0 +1 @@
</Account>

View File

@@ -0,0 +1,19 @@
<?php
$LoginName = "";
$raw = file_get_contents('php://input');
$matches = array();
preg_match('/<EMailAddress>(.*)<\/EMailAddress>/', $raw, $matches);
if (isset($matches[1])) \{
$LoginName = "<LoginName>".$matches[1]."</LoginName>";
\}
$email = array_key_exists('email', $_GET) ? $_GET['email'] : null;
$email = filter_var($email, FILTER_VALIDATE_EMAIL);
if (array_key_exists('email', $_GET)) \{
$LoginName = "<LoginName>".$email."</LoginName>";
\}
header('Content-Type: application/xml');
?>
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"; ?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">

View File

@@ -0,0 +1,2 @@
</Response>
</Autodiscover>

View File

@@ -0,0 +1,7 @@
<emailProvider id="<?php echo $_SERVER['SERVER_NAME']; ?>">
<domain><?php echo $_SERVER['SERVER_NAME']; ?></domain>
<domain><?php echo "www.".$_SERVER['SERVER_NAME']; ?></domain>
<displayName><?php echo $_SERVER['SERVER_NAME'] . " Emails"; ?></displayName>
<displayShortName><?php echo $_SERVER['SERVER_NAME']; ?></displayShortName>

View File

@@ -0,0 +1,20 @@
{
return " <!-- no IMAP server available-->\n" if $imaps{'status'} eq "disabled" && $imap{'access'} eq "localhost";
$port=$imaps{'TCPPort'} || '993';
$socket="SSL";
if ($imaps{'status'} eq "disabled") {
$port=$qpsmtpd{'TCPPort'} || '143';
$socket="STARTTLS";
}
$OUT=<<"string_ending_delimiter";
<incomingServer type="imap">
<hostname><?php echo \$_SERVER['SERVER_NAME']; ?></hostname>
<port>$port</port>
<socketType>$socket</socketType>
<username>\%EMAILLOCALPART\%</username>
<authentication>password-cleartext</authentication>
</incomingServer>
string_ending_delimiter
}

View File

@@ -0,0 +1,26 @@
{
return " <!-- no POP3 server available-->\n" if $pop3s{'status'} eq "disabled" && $pop3s{'status'} eq "disabled";
$port=$pop3s{'TCPPort'} || '995';
$socket="SSL";
if ($pop3s{'status'} eq "disabled" && $pop3{'status'} eq "enabled") {
$port=$pop3{'TCPPort'} || '25';
$socket="STARTTLS";
}
$OUT=<<"string_ending_delimiter";
<incomingServer type="pop3">
<hostname><?php echo \$_SERVER['SERVER_NAME']; ?></hostname>
<port>$port</port>
<socketType>$socket</socketType>
<username>\%EMAILLOCALPART\%</username>
<authentication>password-cleartext</authentication>
<pop3>
<leaveMessagesOnServer>true</leaveMessagesOnServer>
<downloadOnBiff>true</downloadOnBiff>
<daysToLeaveMessagesOnServer>14</daysToLeaveMessagesOnServer>
</pop3>
<!-- <password>optional: the user's password</password>-->
</incomingServer>
string_ending_delimiter
}

View File

@@ -0,0 +1,23 @@
{
return " <!-- no SMTP server available-->" if $sqpsmtpd{'status'} eq "disabled" && $qpsmtpd{'status'} eq "disabled";
$port=$sqpsmtpd{'TCPPort'} || '465';
$socket="SSL";
if ($sqpsmtpd{'status'} eq "disabled") {
$port=$qpsmtpd{'TCPPort'} || '25';
$socket="STARTTLS";
}
$OUT=<<"string_ending_delimiter";
<outgoingServer type="smtp">
<hostname><?php echo \$_SERVER['SERVER_NAME']; ?></hostname>
<port>$port</port>
<socketType>$socket</socketType>
<username>\%EMAILLOCALPART\%</username>
<authentication>password-cleartext</authentication>
<!-- <restriction>client-IP-address</restriction> -->
<addThisServer>true</addThisServer>
<useGlobalPreferredServer>true</useGlobalPreferredServer>
</outgoingServer>
string_ending_delimiter
}

View File

@@ -0,0 +1,8 @@
{
# <identity>
# <!-- needed? -->
# <!-- We don't want Verizon setting "Organization: Verizon"
# for its customers -->
# </identity>
$OUT = "";
}

View File

@@ -0,0 +1,22 @@
{
# <!-- A page where the ISP describes the configuration.
# This is purely informational and currently mainly for
# maintenance of the files and not used by the client at all.
# Note that we do not necessarily use exactly the config suggested
# by the ISP, e.g. when they don't recommend SSL, but it's available,
# we will configure SSL.
# The text content should contains a description in the native
# language of the ISP (customers), and a short English description,
# mostly for us.
# -->
$docpath=$autodiscover{'DocURL'} || "undef";
return "" if $docpath eq "undef";
$OUT=<<"string_ending_delimiter";
<documentation url="http://<?php echo \$_SERVER['SERVER_NAME']; ?>/$docpath">
<descr lang="en">Configure Thunderbird 2.0 for IMAP</descr>
<descr lang="de">Thunderbird 2.0 mit IMAP konfigurieren</descr>
<descr lang="fr">Configuration de Thunderbird 2.0 avec IMAP</descr>
</documentation>
string_ending_delimiter
}

View File

@@ -0,0 +1,2 @@
</emailProvider>

View File

@@ -0,0 +1,18 @@
{
# <!-- This allows to access the webmail service of the provider.
# The URLs are loaded into a standard webbrowser for the user.
# Specifying this is optional. -->
return " <!-- no webmail available-->" if $horde{'status'} eq "disabled";
$OUT=<<'string_ending_delimiter';
<webMail>
<loginPage url="https://<?php echo $_SERVER['SERVER_NAME']; ?>/webmail" />
<loginPageInfo url="https://<?php echo $_SERVER['SERVER_NAME']; ?>/webmail">
<username>%EMAILLOCALPART%</username>
<usernameField id="horde_user" name="horde_user" />
<passwordField id="horde_pass" name="horde_pass" />
<loginButton id="login_button" name="login_button"/>
</loginPageInfo>
</webMail>
string_ending_delimiter
}

View File

@@ -0,0 +1 @@
<clientConfigUpdate url="https://<?php echo $_SERVER['SERVER_NAME']; ?>/.well-known/autoconfig/mail/config-v1.1.xml" />

View File

@@ -0,0 +1,3 @@
<?php header("Content-Type: application/xml"); ?>
<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>
<clientConfig version="1.1">

View File

@@ -0,0 +1 @@
</clientConfig>