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

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.rpm
*.log
*spec-20*
*.tar.gz

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
# Makefile for source rpm: smeserver-autodiscover
# $Id: Makefile,v 1.1 2022/07/13 21:19:56 jpp Exp $
NAME := smeserver-autodiscover
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -1,3 +1,15 @@
# smeserver-autodiscover
# <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> smeserver-autodiscover
SMEServer Koozali developed git repo for smeserver-autodiscover smecontribs
## Wiki
<br />https://wiki.koozali.org/Autodiscover
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-autodiscover&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
*Once it has been checked, then this comment will be deleted*
<br />

1
contriborbase Normal file
View File

@ -0,0 +1 @@
contribs10

49
createlinks Normal file
View File

@ -0,0 +1,49 @@
#!/usr/bin/perl
use strict;
use esmith::Build::CreateLinks qw(:all);
my $pkg= "smeserver-autodiscover";
my $event = "${pkg}-update";
#event_actions($event, qw(
# systemd-default 88
# systemd-reload 89
#));
event_templates($event, qw(
/var/www/Autodiscover/Mozilla.php
/var/www/Autodiscover/Autodiscover.php
/etc/httpd/conf/httpd.conf
));
event_services($event, qw(
httpd-e-smith reload-or-restart
));
#email-update
$event ="email-update";
event_templates($event, qw(
/var/www/Autodiscover/Mozilla.php
/var/www/Autodiscover/Autodiscover.php
));
#webapps-update
$event ="webapps-update";
event_templates($event, qw(
/var/www/Autodiscover/Mozilla.php
/var/www/Autodiscover/Autodiscover.php
));
#remoteaccess-update
$event ="remoteaccess-update";
event_templates($event, qw(
/var/www/Autodiscover/Mozilla.php
/var/www/Autodiscover/Autodiscover.php
));
#use esmith::Build::Backup qw(:all);
#backup_includes($pkg, qw( ));

View File

@ -0,0 +1 @@
public

View File

@ -0,0 +1 @@
enabled

View File

@ -0,0 +1 @@
configuration

View File

@ -0,0 +1,3 @@
PERMS=0640
UID="www"
GID="www"

View File

@ -0,0 +1,3 @@
PERMS=0640
UID="www"
GID="www"

View File

@ -0,0 +1,10 @@
<Directory /var/www/Autodiscover/>
{
$OUT = ( ($autodiscover || "public") eq "public" ) ? " Require all granted\n Allow from all\n" : " Require ip $localAccess $externalSSLAccess\n Allow from all $localAccess $externalSSLAccess\n ";
}
<FilesMatch \.php$>
<If "-f %\{SCRIPT_FILENAME\}">
SetHandler "proxy:unix:/var/run/php-fpm/php80.sock|fcgi://localhost"
</If>
</FilesMatch>
</Directory>

View File

@ -0,0 +1,18 @@
{
return "# autodiscover disabled\n" unless $autodiscover{'status'} eq "enabled";
if ($port eq $httpsPort)
{
$OUT .= 'Alias /autodiscover/autodiscover.xml "/var/www/Autodiscover/Autodiscover.php"'."\n";
$OUT .= 'Alias /Autodiscover/Autodiscover.xml "/var/www/Autodiscover/Autodiscover.php"'."\n";
$OUT .= 'Alias /AutoDiscover/AutoDiscover.xml "/var/www/Autodiscover/Autodiscover.php"'."\n";
$OUT .= 'Alias /.well-known/autoconfig/mail/config-v1.1.xml "/var/www/Autodiscover/Mozilla.php"'."\n";
}
else
{
$OUT .= 'RedirectMatch 302 ^/\.well-known/autoconfig/mail/config-v1\.1\.xml(.*|$) https://%{HTTP_HOST}/.well-known/autoconfig/mail/config-v1.1.xml$1 '."\n";
$OUT .= 'RedirectMatch 302 ^/(a|A)utodiscover(/.*|$) https://%{HTTP_HOST}/autodiscover$2 '."\n";
}
}

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,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>

View File

@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\16.0\Outlook\setup]
"DisableOffice365SimplifiedAccountCreation"=dword:00000001

View File

@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\19.0\Outlook\setup]
"DisableOffice365SimplifiedAccountCreation"=dword:00000001

0
root/var/www/Autodiscover/.gitignore vendored Normal file
View File

View File

@ -0,0 +1,47 @@
Name: smeserver-autodiscover
Version: 1.0.0
Release: 1%{?dist}
Summary: Koozali SME Server autodiscovery
License: GPL
URL: https://wiki.koozali.org/Autodiscover
Source: %{name}-%{version}.tar.xz
BuildArch: noarch
BuildRequires: e-smith-devtools
%description
Koozali SME Server autodiscovery
configure your mail client with ease.
%prep
%setup
%build
perl createlinks
%install
rm -rf %{buildroot}
(cd root ; find . -depth -print | cpio -dump %{buildroot})
/sbin/e-smith/genfilelist %{buildroot} \
--dir '/var/www/Autodiscover/' 'attr(0750,root,www)' \
> %{name}-%{version}-%{release}-filelist
%files -f %{name}-%{version}-%{release}-filelist
%defattr(-,root,root)
%changelog
* Sat Sep 07 2024 cvs2git.sh aka Brian Read <brianr@koozali.org> 1.0.0-1.sme
- Roll up patches and move to git repo [SME: 12338]
* Sat Sep 07 2024 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Wed Jul 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.0.0-1.sme
- initial release [SME: 10842]