From 92f25f66f1970960b5131d3df0f74a4c86a2cea0 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sat, 31 Mar 2012 14:26:38 +0200 Subject: [PATCH] initial commit --- createlinks | 7 ++++ .../db/configuration/defaults/sogosync/access | 1 + .../db/configuration/defaults/sogosync/status | 1 + .../db/configuration/defaults/sogosync/type | 1 + root/etc/e-smith/db/configuration/sogosync/access | 1 + root/etc/e-smith/db/configuration/sogosync/status | 1 + root/etc/e-smith/db/configuration/sogosync/type | 1 + .../templates/etc/httpd/conf/httpd.conf/98SOGoSync | 36 ++++++++++++++++++ .../conf/httpd.conf/VirtualHost/61RedirSOGoSync | 13 +++++++ .../templates/etc/sogosync/config.php/10TimeZone | 3 ++ .../templates/etc/sogosync/config.php/20BasePath | 2 + .../templates/etc/sogosync/config.php/30Options | 8 ++++ .../templates/etc/sogosync/config.php/40Backend | 1 + .../etc/sogosync/config.php/45Backend10Mapi | 1 + .../etc/sogosync/config.php/45Backend20Imap | 8 ++++ .../etc/sogosync/config.php/45Backend30Maildir | 2 + .../etc/sogosync/config.php/45Backend40Vcard | 1 + .../sogosync/config.php/45Backend50SearchProvider | 1 + .../etc/sogosync/config.php/45Backend60Caldav | 1 + .../etc/sogosync/config.php/45Backend70Carddav | 1 + smeserver-sogosync.spec | 44 ++++++++++++++++++++++ 21 files changed, 135 insertions(+) create mode 100644 createlinks create mode 100644 root/etc/e-smith/db/configuration/defaults/sogosync/access create mode 100644 root/etc/e-smith/db/configuration/defaults/sogosync/status create mode 100644 root/etc/e-smith/db/configuration/defaults/sogosync/type create mode 100644 root/etc/e-smith/db/configuration/sogosync/access create mode 100644 root/etc/e-smith/db/configuration/sogosync/status create mode 100644 root/etc/e-smith/db/configuration/sogosync/type create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98SOGoSync create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHost/61RedirSOGoSync create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/10TimeZone create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/20BasePath create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/30Options create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/40Backend create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/45Backend10Mapi create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/45Backend20Imap create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/45Backend30Maildir create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/45Backend40Vcard create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/45Backend50SearchProvider create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/45Backend60Caldav create mode 100644 root/etc/e-smith/templates/etc/sogosync/config.php/45Backend70Carddav create mode 100644 smeserver-sogosync.spec diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..9cc1741 --- /dev/null +++ b/createlinks @@ -0,0 +1,7 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); + +templates2events("/etc/sogosync/config.php", qw(webapps-update bootstrap-console-save email-update)); +safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/etc/sogosync/config.php/template-begin"); +safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/etc/sogosync/config.php/template-end"); diff --git a/root/etc/e-smith/db/configuration/defaults/sogosync/access b/root/etc/e-smith/db/configuration/defaults/sogosync/access new file mode 100644 index 0000000..a48cf0d --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sogosync/access @@ -0,0 +1 @@ +public diff --git a/root/etc/e-smith/db/configuration/defaults/sogosync/status b/root/etc/e-smith/db/configuration/defaults/sogosync/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sogosync/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/sogosync/type b/root/etc/e-smith/db/configuration/defaults/sogosync/type new file mode 100644 index 0000000..1b93c9e --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/sogosync/type @@ -0,0 +1 @@ +webapp diff --git a/root/etc/e-smith/db/configuration/sogosync/access b/root/etc/e-smith/db/configuration/sogosync/access new file mode 100644 index 0000000..a48cf0d --- /dev/null +++ b/root/etc/e-smith/db/configuration/sogosync/access @@ -0,0 +1 @@ +public diff --git a/root/etc/e-smith/db/configuration/sogosync/status b/root/etc/e-smith/db/configuration/sogosync/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/sogosync/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/sogosync/type b/root/etc/e-smith/db/configuration/sogosync/type new file mode 100644 index 0000000..1b93c9e --- /dev/null +++ b/root/etc/e-smith/db/configuration/sogosync/type @@ -0,0 +1 @@ +webapp diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98SOGoSync b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98SOGoSync new file mode 100644 index 0000000..7f6b38a --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98SOGoSync @@ -0,0 +1,36 @@ +{ +my $sogosync = $sogosync{'status'} || 'enabled'; +my $access = $sogosync{'access'} || 'private'; +my $allow = ($access eq 'public') ? 'all':"$localAccess $externalSSLAccess"; + +if ($sogosync eq 'enabled'){ + $OUT .=<<"EOF"; + +Alias /Microsoft-Server-ActiveSync /usr/share/sogosync/index.php + + + SSLRequireSSL on + AddType application/x-httpd-php .php .php3 + AllowOverride None + php_admin_flag magic_quotes_gpc off + php_admin_flag register_globals off + php_admin_flag magic_quotes_runtime off + php_admin_flag short_open_tag on + php_admin_value open_basedir /usr/share/sogosync:/usr/share/awl/inc:/var/lib/sogosync/:/etc/sogosync + php_admin_value include_path /usr/share/sogosync:/usr/share/awl/inc:/etc/sogosync + Order deny,allow + Deny from all + Allow from $allow + + + + Deny from all + + +EOF + +} +else{ + $OUT .= "# sogosync is disabled\n"; +} +} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHost/61RedirSOGoSync b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHost/61RedirSOGoSync new file mode 100644 index 0000000..486677b --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHost/61RedirSOGoSync @@ -0,0 +1,13 @@ +{ +my $sslport = $modSSL{'TCPPort'} || '443'; +my $sogosync = $sogosync{'status'} || 'enabled'; + +if (($port ne $sslport) && ($sogosync eq 'enabled')){ + + ## Redirect Web Address to Secure Address + $OUT .= " RewriteEngine on\n"; + $OUT .= " RewriteRule ^/Microsoft-Server-ActiveSync(/.*|\$) https://%{HTTP_HOST}/Microsoft-Server-ActiveSync\$1 \[L,R\]\n"; + +} +} + diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/10TimeZone b/root/etc/e-smith/templates/etc/sogosync/config.php/10TimeZone new file mode 100644 index 0000000..ff62db4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/10TimeZone @@ -0,0 +1,3 @@ + if (function_exists("date_default_timezone_set"))\{ + date_default_timezone_set("{$TimeZone}"); + \} diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/20BasePath b/root/etc/e-smith/templates/etc/sogosync/config.php/20BasePath new file mode 100644 index 0000000..ba14e09 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/20BasePath @@ -0,0 +1,2 @@ + define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']) . "/"); + define('STATE_DIR', '/var/lib/sogosync'); diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/30Options b/root/etc/e-smith/templates/etc/sogosync/config.php/30Options new file mode 100644 index 0000000..d8f21e4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/30Options @@ -0,0 +1,8 @@ + define('SCRIPT_TIMEOUT', 0); + define('MAX_EMBEDDED_SIZE', 1048576); + define('PROVISIONING', true); + define('LOOSE_PROVISIONING', false); + define('SYNC_CONFLICT_DEFAULT', SYNC_CONFLICT_OVERWRITE_PIM); + define('SYNC_FILTERTIME_MAX', SYNC_FILTERTYPE_ALL); + define('PING_INTERVAL', 30); + diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/40Backend b/root/etc/e-smith/templates/etc/sogosync/config.php/40Backend new file mode 100644 index 0000000..e85c7e3 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/40Backend @@ -0,0 +1 @@ + $BACKEND_PROVIDER = "BackendCombined"; diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend10Mapi b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend10Mapi new file mode 100644 index 0000000..8344015 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend10Mapi @@ -0,0 +1 @@ + define('MAPI_SERVER', 'file:///var/run/zarafa'); diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend20Imap b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend20Imap new file mode 100644 index 0000000..bf99ce9 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend20Imap @@ -0,0 +1,8 @@ + define('IMAP_SERVER', 'localhost'); + define('IMAP_PORT', {$imap{'TCPPort'}}); + define('IMAP_OPTIONS', '/notls/norsh'); + define('IMAP_DEFAULTFROM', ''); + define('IMAP_SENTFOLDER', ''); + define('IMAP_INLINE_FORWARD', false); + define('IMAP_USE_IMAPMAIL', true); + diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend30Maildir b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend30Maildir new file mode 100644 index 0000000..c682d7d --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend30Maildir @@ -0,0 +1,2 @@ + define('MAILDIR_BASE', '/tmp'); + define('MAILDIR_SUBDIR', 'Maildir'); diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend40Vcard b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend40Vcard new file mode 100644 index 0000000..6391db0 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend40Vcard @@ -0,0 +1 @@ + define('VCARDDIR_DIR', '/home/%u/.kde/share/apps/kabc/stdvcf'); diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend50SearchProvider b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend50SearchProvider new file mode 100644 index 0000000..0222d65 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend50SearchProvider @@ -0,0 +1 @@ + define('SEARCH_PROVIDER', 'SearchLDAP'); diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend60Caldav b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend60Caldav new file mode 100644 index 0000000..7fec142 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend60Caldav @@ -0,0 +1 @@ + define('CALDAV_URL', 'http://localhost:{$sogod{'TCPPort'}}/SOGo/dav/%u/'); diff --git a/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend70Carddav b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend70Carddav new file mode 100644 index 0000000..a4ab279 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sogosync/config.php/45Backend70Carddav @@ -0,0 +1 @@ + define('CARDDAV_URL', 'http://localhost:{$sogod{'TCPPort'}}/SOGo/dav/%u/Contacts/'); diff --git a/smeserver-sogosync.spec b/smeserver-sogosync.spec new file mode 100644 index 0000000..2cdd059 --- /dev/null +++ b/smeserver-sogosync.spec @@ -0,0 +1,44 @@ +Name: smeserver-sogosync +Version: 0.0.1 +Release: 0.beta1%{?dist} +Summary: SME Server integration for sogosync + +Group: Application/System +License: GNU GPL v2 +URL: https://github.com/xbgmsharp/sogosync +Source0: %{name}-%{version}.tar.gz +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +BuildArch: noarch + +BuildRequires: e-smith-devtools +Requires: smeserver-webapps-common +Requires: sogosync + +%description +Integrate sogosync, which provides an ActiveSync compatible server for SOGo, +based on Z-Push + + +%prep +%setup -q -n %{name}-%{version} + +%build +perl ./createlinks + +%install +rm -rf $RPM_BUILD_ROOT +(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) +/bin/rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + > %{name}-%{version}-filelist + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) + + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog +* Sat Mar 31 2012 Daniel Berteaud 0.0.1-1 +- initial package