Compare commits

...

86 Commits

Author SHA1 Message Date
Daniel Berteaud
3a72fe43dc Automatic commit of package [ipasserelle-groupware] release [0.2.37-1].
Created by command:

/usr/bin/tito tag
2018-03-27 15:40:36 +02:00
Daniel Berteaud
62c72063a3 Configure tito 2018-03-27 15:40:06 +02:00
Daniel Berteaud
f3886a8d31 Initialized to use tito. 2018-03-27 15:39:40 +02:00
Daniel Berteaud
71a13a0f32 Adapt spec file for tito 2018-03-27 15:37:28 +02:00
Daniel Berteaud
d4b8c580c8 Also use / separator when PublicMailbox is enabled 2018-03-27 15:34:45 +02:00
Daniel Berteaud
a92c967750 Spec file update 2017-07-03 11:52:40 +02:00
Daniel Berteaud
1bf49af229 Add optional debug directives 2017-07-03 11:26:27 +02:00
Daniel Berteaud
895af6c23d Spec file update 2017-06-20 17:25:49 +02:00
Daniel Berteaud
78dd537c35 Allow setting number of workers 2017-06-20 17:02:59 +02:00
Daniel Berteaud
3367ad69ac Spec file update 2017-03-23 14:29:07 +01:00
Daniel Berteaud
2dc55fdd13 Use expire-autoreply for SOGo 2 instead of update-autoreply 2017-03-23 14:26:54 +01:00
Daniel Berteaud
1ed7ed509a Spec file update 2017-02-16 12:58:18 +01:00
Daniel Berteaud
d3d85fae71 Set a shorter cache TTL when not using CAS authentication 2017-02-16 11:32:28 +01:00
Daniel Berteaud
90d3c32e99 Spec file update 2017-01-09 15:02:52 +01:00
Daniel Berteaud
0e49554d1d Fix permission on sieve master passwd file 2017-01-05 09:26:05 +01:00
Daniel Berteaud
2079b392f8 Remove custom login page template 2017-01-03 12:28:26 +01:00
Daniel Berteaud
fcc5bf15a3 Set Junk folder 2017-01-03 12:25:24 +01:00
Daniel Berteaud
987e0e06b4 Add support for vacation scheduling using a sieve admin account 2017-01-03 12:14:36 +01:00
Daniel Berteaud
3cb2b15e1c Spec file update 2016-06-24 10:37:33 +02:00
Daniel Berteaud
342ecc8603 Use / separator when dovecot has SharedMailbox enabled 2016-06-24 09:43:15 +02:00
Daniel Berteaud
d2a1a9ea7c Spec file update 2016-06-08 12:21:16 +02:00
Daniel Berteaud
6a16066b0e Possibility to set memory limit 2016-06-08 11:32:21 +02:00
Daniel Berteaud
87f6353679 Spec file update 2016-06-06 16:05:30 +02:00
Daniel Berteaud
bea4d69eda Set . as mailbox separator 2016-06-06 16:04:34 +02:00
Daniel Berteaud
562f3c5482 Spec file update 2015-06-03 12:39:12 +02:00
Daniel Berteaud
2a929928ab Upgrade DB schema to 2.3 2015-06-03 12:38:27 +02:00
Daniel Berteaud
1178bfe145 Spec file update 2015-03-25 16:50:09 +01:00
Daniel Berteaud
4572b13456 Allow cross site requests on dav resources 2015-03-25 16:49:15 +01:00
Daniel Berteaud
c732cb5a8f Spec file update 2015-03-05 11:06:38 +01:00
Daniel Berteaud
ca95ee7843 Put iPasserelle logo in the correct dir 2015-03-05 10:34:42 +01:00
Daniel Berteaud
da46b8c31b Update Login page wox template 2015-03-05 10:29:15 +01:00
Daniel Berteaud
07e7af8352 Add an Authentication prop to use SOGo's internal auth 2015-03-05 09:22:35 +01:00
Daniel Berteaud
6d2bab5610 Spec file update 2015-02-18 12:38:48 +01:00
Daniel Berteaud
01d9b52f02 Allow EAS push 2015-02-18 12:36:17 +01:00
Daniel Berteaud
b32d9f4097 Spec file update 2015-02-17 17:03:45 +01:00
Daniel Berteaud
9f2ae4f142 Increase memcached cache duration to 2 hours
And completly disable dovecot's negative cache
2015-02-17 17:00:41 +01:00
Daniel Berteaud
3f0586bf75 Spec file update 2015-02-17 16:55:23 +01:00
Daniel Berteaud
085c1ac457 Add %w to cache_key (dovecot's passdb args)
This way, concurrent SOGo sessions using different PT can work
2015-02-17 16:48:33 +01:00
Daniel Berteaud
5b34ddb128 Spec file update 2015-01-21 15:02:41 +01:00
Daniel Berteaud
f172776341 Dovecot ttl are in seconds 2015-01-21 15:01:07 +01:00
Daniel Berteaud
cab360890e Spec file update 2015-01-21 12:26:13 +01:00
Daniel Berteaud
4210f96b85 Make auth cache last as long as sogo's memcached 2015-01-21 10:32:54 +01:00
Daniel Berteaud
04a8d8c25e Spec file update 2015-01-07 17:53:56 +01:00
Daniel Berteaud
552a4c952f Enable IMAP Pooling to reduce auth against the imap backend 2015-01-07 17:49:43 +01:00
Daniel Berteaud
4dfed29ff7 Enable dovecot auth cache 2015-01-07 17:49:33 +01:00
Daniel Berteaud
69c67f0d41 Spec file update 2014-09-11 09:38:01 +02:00
Daniel Berteaud
046099ae15 Update refresh parameter for SOGo 2.2.8 2014-09-11 09:30:54 +02:00
Daniel Berteaud
851a6b7aca Spec file update 2014-06-25 14:05:33 +02:00
Daniel Berteaud
68a1c2bb80 Use sogo-tool to expire session 2014-06-25 14:04:30 +02:00
Daniel Berteaud
c217527459 Spec file update 2014-02-25 10:50:01 +01:00
Daniel Berteaud
3c98ec9f9d Fix an AliasMatch directive in httpd.conf template 2014-02-25 10:48:13 +01:00
Daniel Berteaud
91189e6845 Add a default reminder 15 minutes before appointments 2014-02-25 10:48:06 +01:00
Daniel Berteaud
44326eb43a Optionaly enable ActiveSync support (default is disabled) 2014-02-25 10:47:57 +01:00
Daniel Berteaud
5067338ba9 Spec file update 2013-12-20 14:22:08 +01:00
Daniel Berteaud
167c68b571 Remove EMailAlarm option, and force it to disabled, it's not working 2013-12-20 14:21:10 +01:00
Daniel Berteaud
7ec03654f4 Spec file update 2013-12-12 11:53:25 +01:00
Daniel Berteaud
fd56f72c98 Template /etc/sogo/sogo.conf instead of /var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults 2013-12-12 11:51:56 +01:00
Daniel Berteaud
f34b69c279 Do not build for noarch, we have C code to compile now 2013-11-12 13:30:11 +01:00
Daniel Berteaud
f2b45b51c3 update spec file 2013-11-12 13:23:46 +01:00
Daniel Berteaud
da9c39e410 Adapt perl lib path for EL6 2013-11-12 13:22:58 +01:00
Daniel Berteaud
e3dada4222 update spec file 2013-09-30 11:18:16 +02:00
Daniel Berteaud
a9bf85ada8 Increase Cache Cleanup interval to 1800 so we don't need too much CAS re-validation 2013-09-30 09:43:16 +02:00
Daniel Berteaud
dbd5fa996d update spec file 2013-09-24 12:26:11 +02:00
Daniel Berteaud
316c09a577 Fix mailappt.png logo in the portal 2013-09-18 19:02:02 +02:00
Daniel Berteaud
325b033df2 Fix httpd template to restrict access to the casProxy handler 2013-09-17 16:25:27 +02:00
Daniel Berteaud
ac381110ec Add the cas-proxy-validate script with a setuid wrapper 2013-09-17 13:56:10 +02:00
Daniel Berteaud
c8eb7a0e88 update spec file 2013-09-17 13:52:28 +02:00
Daniel Berteaud
23fc0aef0e Fix indention and enable logout 2013-09-17 12:23:42 +02:00
Daniel Berteaud
09229996a1 Enable CAS authentication if smeserver-dovecot is installed 2013-09-17 10:34:20 +02:00
Daniel Berteaud
84cedb6958 update spec file 2013-09-17 10:05:54 +02:00
Daniel Berteaud
0e1be06dd2 Revert "Use a dot instead of slash as folder separator for sieve rules"
This reverts commit 5f7f443e09.
2013-08-23 12:17:57 +02:00
Daniel Berteaud
127c41e8e9 udpate spec file 2013-08-23 11:29:05 +02:00
Daniel Berteaud
5f7f443e09 Use a dot instead of slash as folder separator for sieve rules 2013-08-23 10:58:33 +02:00
Daniel Berteaud
c51776ab61 update sepc file 2013-06-13 18:39:54 +02:00
Daniel Berteaud
5977a844fa Increase workers (1 worker for 8 users) 2013-06-13 12:29:38 +02:00
Daniel Berteaud
29b9b47a6a update spec file 2013-03-28 18:31:28 +01:00
Daniel Berteaud
591ddc96ad Run sogo-upgrade during bootstrap-console-save 2013-03-28 18:30:37 +01:00
Daniel Berteaud
0e356b1b56 update spec file 2013-03-15 16:08:08 +01:00
Daniel Berteaud
a12257afaf cleanup database creation, change sogo home to /var/lib/sogo and change default shell to /sbin/nologin 2013-03-15 16:06:27 +01:00
Daniel Berteaud
f2e894d03e Add a qpsmtpd plugin to fix SOGo headers case 2013-03-15 13:26:27 +01:00
Daniel Berteaud
2549c87453 update spec file 2012-12-28 16:53:25 +01:00
Daniel Berteaud
10752dfca1 First week of year is the first 4 days week 2012-12-28 16:32:48 +01:00
Daniel Berteaud
298e717be1 update spec file 2012-12-19 17:17:14 +01:00
Daniel Berteaud
b4453f49a3 Add a popup blocker exception in Firefox for SOGo URL 2012-12-19 17:16:25 +01:00
Daniel Berteaud
dfde299267 Update spec file 2012-11-30 08:30:57 +01:00
Daniel Berteaud
aaf8a30688 Delete SOGo data on user removal 2012-11-28 17:22:35 +01:00
76 changed files with 668 additions and 209 deletions

3
.tito/packages/.readme Normal file
View File

@ -0,0 +1,3 @@
the .tito/packages directory contains metadata files
named after their packages. Each file has the latest tagged
version and the project's relative directory.

View File

@ -0,0 +1 @@
0.2.37-1 ./

1
.tito/releasers.conf Symbolic link
View File

@ -0,0 +1 @@
../../tito_libs/releasers.conf

6
.tito/tito.props Normal file
View File

@ -0,0 +1,6 @@
[buildconfig]
builder = tito.builder.Builder
tagger = tito.tagger.VersionTagger
changelog_do_not_remove_cherrypick = 0
changelog_format = %s (%ae)
lib_dir = ../tito_libs

10
cas-proxy-validate.c Normal file
View File

@ -0,0 +1,10 @@
#include <unistd.h>
#ifndef REAL_PATH
#define REAL_PATH "/usr/share/SOGo/cgi-bin/cas-proxy-validate.py"
#endif
int main(ac, av)
char **av;
{
execv(REAL_PATH, av);
return 0;
}

View File

@ -5,13 +5,14 @@ use esmith::Build::CreateLinks qw(:all);
service_link_enhanced("memcached-sogo", "S55", "7");
service_link_enhanced("sogod", "S85", "7");
templates2events("/etc/e-smith/sql/init/30sogo_mysql_create_database", qw(email-update bootstrap-console-save));
templates2events("/etc/e-smith/sql/init/31sogo_mysql_update_privileges", qw(email-update bootstrap-console-save));
templates2events("/home/sogo/smeserver/sogo_mysql_update_privileges.sql", qw(email-update bootstrap-console-save));
templates2events("/etc/cron.d/sogo-alarm", qw(email-update bootstrap-console-save));
templates2events("/home/sogo/GNUstep/Defaults/.GNUstepDefaults", qw(email-update bootstrap-console-save pre-backup));
templates2events("/etc/e-smith/sql/init/sogo", qw(email-update bootstrap-console-save));
templates2events("/etc/sogo/sogo.conf", qw(email-update bootstrap-console-save pre-backup));
templates2events("/etc/sysconfig/sogo", qw(email-update bootstrap-console-save));
templates2events("/etc/logrotate.d/sogo", qw(email-update bootstrap-console-save));
templates2events("/etc/pam.d/dovecot", qw(email-update bootstrap-console-save));
templates2events("/etc/sogo/sieve.creds", qw(email-update bootstrap-console-save));
templates2events("/etc/cron.d/sogo", qw(email-update bootstrap-console-save));
templates2events("/etc/dovecot/master.sieve.127.0.0.1", qw(email-update bootstrap-console-save));
safe_symlink("restart", "root/etc/e-smith/events/email-update/services2adjust/sogod");
safe_symlink("restart", "root/etc/e-smith/events/email-update/services2adjust/memcached-sogo");
@ -20,6 +21,9 @@ safe_symlink("restart", "root/etc/e-smith/events/email-update/services2adjust/my
event_link("sogo-delete-backup", "pre-backup", "60");
event_link("sogo-delete-backup", "post-backup", "60");
event_link("sogo-backup", "pre-backup", "70");
event_link("sogo-delete-user", "user-delete", "10");
event_link("sogo-upgrade", "email-update", "20");
event_link("sogo-upgrade", "bootstrap-console-save", "80");
panel_link("sogo", "manager");

View File

@ -1,28 +1,32 @@
%define version 0.2.3
%define release 1
%define name ipasserelle-groupware
%define debug_package %{nil}
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Name: ipasserelle-groupware
Version: 0.2.37
Release: 1%{?dist}
Epoch: 9
Summary: iPasserelle Groupware module
Group: Networking/Daemons
License: GPLv3+
URL: http://www.ipasserelle.com
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRoot: BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildRequires: e-smith-devtools
BuildRequires: gcc
Requires: smeserver-release >= 8
Requires: e-smith-ldap >= 5.2.0-19
Requires: sogo >= 1.3.9
Requires: sogo >= 2.3.0
Requires: sogo-tool
Requires: sogo-activesync
Requires: sope49-gdl1-mysql
Requires: sogo-ealarms-notify
Requires: ipasserelle-base
Requires: memcached
Requires: ipasserelle-portal
Requires: smeserver-lemonldap-ng >= 0.2.6
Requires: smeserver-pam_cas
Requires: python-memcached
Obsoletes: smeserver-sogo
Provides: smeserver-sogo
@ -31,9 +35,123 @@ Provides: smeserver-sogo
iPasserelle module for the groupware application.
Based on smeserver-sogo from nethesis
%changelog
* Fri Sep 28 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.3-1
* Tue Mar 27 2018 Daniel Berteaud <daniel@firewall-services.com> 0.2.37-1
- new package built with tito
- Use / separator when using only PublicMailbox
* Mon Jul 3 2017 Daniel Berteaud <daniel@firewall-services.com> - 0.2.36-1
- Add Debug prop to turn on all the debug directives in sogo.conf
* Tue Jun 20 2017 Daniel Berteaud <daniel@firewall-services.com> - 0.2.35-1
- Allow setting the number of workers, or the number of users per worker
* Thu Mar 23 2017 Daniel Berteaud <daniel@firewall-services.com> - 0.2.34-1
- Use expire-autoreply for SOGo v2 instead of update-autoreply
* Thu Feb 16 2017 Daniel Berteaud <daniel@firewall-services.com> - 0.2.33-1
- Set a shorter cache TTL when not using CAS authentication
* Mon Jan 9 2017 Daniel Berteaud <daniel@firewall-services.com> - 0.2.32-1
- Support vacation schedule using a sieve master user
- Set junk folder to junkmail
- Remove custom login page template
* Fri Jun 24 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.2.31-1
- Use / as mailbox separator when shared mailbox is enabled
* Wed Jun 8 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.2.30-1
- Possibility to set sogo per worker memory limit
* Mon Jun 6 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.2.29-1
- Set . as mailbox separator
* Wed Jun 3 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.28-1
- Upgrade DB schema for 2.3.0
* Wed Mar 25 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.27-1
- Allow cross site requests on dav resources
* Thu Mar 5 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.26-1
- Add a Authentication prop to choose between CAS or internal auth
- Update login page wox template
- Put logo_ipasserelle.png in the right directory on x86_64
* Wed Feb 18 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.25-1
- Allow EAS push
* Tue Feb 17 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.24-1
- Increase memcached duration to 2 hours
- Completly disable dovecot's negative cache
* Tue Feb 17 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.23-1
- Fix slow access when logged in from different browsers at the same time
* Wed Jan 21 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.22-1
- Dovecot ttls are in seconds
* Wed Jan 21 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.21-1
- Make dovecot's auth_cache last as long as sogo's memcached
* Wed Jan 7 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.20-1
- Enable dovecot auth_cache
- Enable IMAP pooling to reduce auth against dovecot
* Thu Sep 11 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.2.19-1
- Update refresh parameter for SOGo 2.2.8
* Wed Jun 25 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.2.18-1
- Use sogo-tool to expire sessions
* Tue Feb 25 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.2.17-1
- Add optional support for ActiveSync (default is disabled)
- Add a default reminder 15 minutes before appointments
- Fix an AliasMatch directive in httpd.conf template
* Fri Dec 20 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.16-1
- Remove EMailAlarm option
* Thu Dec 12 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.15-1
- Template /etc/sogo/sogo.conf instead of
/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults
* Tue Nov 12 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.14-1
- New branch for SME9
* Mon Sep 30 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.13-1
- Increase Cache Cleanup interval
* Tue Sep 17 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.12-1
- Enable CAS authentication
* Fri Aug 23 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.11-1
- Revert previous change as it breaks folder management
* Fri Aug 23 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.10-1
- Use a dot instead of a slash as folder separator for sieve rules
* Thu Jun 13 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.9-1
- Use one worker for 8 users
* Thu Mar 28 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.8-1
- Link sogo-upgrade in bootstrap-console-save
* Fri Mar 15 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.7-1
- Add a qpsmtpd plugin to fix SOGo headers case. See
http://sogo.nu/bugs/view.php?id=1047
- Cleanup database creation/privileges modifications
- use /var/lib/sogo instead of /home/sogo
- change shell of sogo to /sbin/nologin
* Fri Dec 28 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.6-1
- First week of year is the first 4 days week
* Wed Dec 19 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.5-1
- Add a popup blocker exception for Firefox via MCD (requires ipasserelle-gp)
* Wed Nov 28 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.4-1
- Remove user data from SOGo database on user removal
* Fri Sep 28 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.3-1
- Add support for /.well-known URL (iOS auto discover)
- Add SRV records for caldav and carddav services
@ -126,7 +244,9 @@ Based on smeserver-sogo from nethesis
%build
%{__mkdir_p} root/var/log/memcached-sogo
%{__mkdir_p} root/usr/share/SOGo/cgi-bin
perl ./createlinks
gcc -o cas-proxy-validate ./cas-proxy-validate.c $RPM_OPT_FLAGS
%install
rm -rf $RPM_BUILD_ROOT
@ -134,17 +254,22 @@ rm -f %{name}-%{version}-filelist
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
install -p cas-proxy-validate $RPM_BUILD_ROOT/usr/share/SOGo/cgi-bin/
%{__mkdir_p} $RPM_BUILD_ROOT%{_libdir}/GNUstep/SOGo/WebServerResources/
install -p logo_ipasserelle.png $RPM_BUILD_ROOT%{_libdir}/GNUstep/SOGo/WebServerResources/logo_ipasserelle.png
%{__mkdir_p} $RPM_BUILD_ROOT/home/e-smith/db/sogo
/sbin/e-smith/genfilelist \
--dir /home/sogo 'attr(0700,sogo,sogo)' \
--dir /home/sogo/GNUstep 'attr(0755,sogo,sogo)' \
--dir /home/sogo/GNUstep/Defaults 'attr(0755,sogo,sogo)' \
--dir /var/lib/sogo 'attr(0700,sogo,sogo)' \
--dir /var/lib/sogo/GNUstep 'attr(0755,sogo,sogo)' \
--dir /var/lib/sogo/GNUstep/Defaults 'attr(0755,sogo,sogo)' \
--dir /home/e-smith/db/sogo 'attr(0700, sogo, sogo)' \
--file /var/service/memcached-sogo/run 'attr(0755, root, root)' \
--file /var/service/memcached-sogo/log/run 'attr(0755, root, root)' \
--dir /var/log/memcached-sogo 'attr(0700, sogo, sogo)' \
--file /etc/cron.hourly/sogo-sessions 'attr(0755, root, root)' \
--file /usr/share/SOGo/cgi-bin/cas-proxy-validate 'attr(4750, sogo, www)' \
--file /usr/share/SOGo/cgi-bin/cas-proxy-validate.py 'attr(0755, sogo, www)' \
$RPM_BUILD_ROOT > %{name}-%{version}-%{release}-filelist
%files -f %{name}-%{version}-%{release}-filelist

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,7 +0,0 @@
#!/bin/bash
TIME=$(/sbin/e-smith/db configuration getprop sogod SessionDuration || echo 1440)
TIME=$(($TIME*60))
# Remove old SOGo sessions entries
/usr/bin/mysql sogo -e "delete from sogo_sessions_folder where unix_timestamp(now())-c_lastseen > $TIME;"

View File

@ -0,0 +1 @@
cache_key=%n%r%l%w

View File

@ -0,0 +1 @@
junkmail

View File

@ -0,0 +1,8 @@
{
# Add the plaintext password to the cache key so concurrent sessions
# from SOGo, using different CAS PT can work
my $args = $DB->get_prop('dovecot', 'PassDBArgs');
if ($args && $args eq 'cache_key=%n%r%l'){
$DB->set_prop('dovecot', 'PassDBArgs', 'cache_key=%n%r%l%w');
}
}

View File

@ -0,0 +1,32 @@
{
my $sogodrec = $DB->get('sogod')
|| $DB->new_record('sogod', {type => 'service'});
my $sogod_sieve_pw = $sogodrec->prop('SieveMasterPassword');
if (not $sogod_sieve_pw or length($sogod_sieve_pw) < 57)
{
use MIME::Base64 qw(encode_base64);
$sogod_sieve_pw = "not set due to error";
if ( open( RANDOM, "/dev/urandom" ) )
{
my $buf;
# 57 bytes is a full line of Base64 coding, and contains
# 456 bits of randomness - given a perfectly random /dev/random
if ( read( RANDOM, $buf, 57 ) != 57 )
{
warn("Short read from /dev/random: $!");
}
else
{
$sogod_sieve_pw = encode_base64($buf);
chomp $sogod_sieve_pw;
}
close RANDOM;
}
else
{
warn "Could not open /dev/urandom: $!";
}
$sogodrec->set_prop('SieveMasterPassword', $sogod_sieve_pw);
}
}

View File

@ -1,4 +1,4 @@
#!/bin/bash
su - sogo -c "/usr/sbin/sogo-tool backup /home/e-smith/db/sogo ALL" > /dev/null 2>&1
su -l -s /bin/bash sogo -c "/usr/sbin/sogo-tool backup /home/e-smith/db/sogo ALL" > /dev/null 2>&1

View File

@ -0,0 +1,16 @@
#!/bin/bash
EVENT=$1
USER=$2
if [ -z "$EVENT" ]; then
echo "event name is missing"
exit 1
fi
if [ -z "$USER" ]; then
echo "user account is missing"
exit 1
fi
su -l -s /bin/bash sogo -c "/usr/sbin/sogo-tool remove $USER" > /dev/null 2>&1

View File

@ -0,0 +1,10 @@
#!/bin/bash
/usr/bin/getent passwd sogo | grep -q '/home/sogo'
if [ $? -eq 0 ]; then
/usr/sbin/usermod -d /var/lib/sogo -m -s /sbin/nologin -c "SOGo daemon" sogo 2>/dev/null
fi
rm -f /var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults
rm -f /etc/cron.d/sogo-alarm

View File

@ -23,14 +23,6 @@
<base>SEND_ACL_MAIL</base>
<trans>Notification des changements de droit d'accès</trans>
</entry>
<entry>
<base>MAIL_ALARM_DESC</base>
<trans>Par défaut, SOGo affiche un pop-up pour vous rappeler vos rendez-vous. Si vous activez cette fonction, les utilisateurs pourront également recevoir un mail de rappel</trans>
</entry>
<entry>
<base>MAIL_ALARM</base>
<trans>Rappel par mail</trans>
</entry>
<entry>
<base>AUX_ACCOUNTS_DESC</base>
<trans>Si cette fonction est activée, les utilisateurs pourront s'abonner à des comptes IMAP externes. Ils pourront ainsi gérer tous leurs comptes emails depuis l'interface web. Souhaitez-vous activer cette fonction ?</trans>

View File

@ -0,0 +1,2 @@
PERMS=0640
GID="dovecot"

View File

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

View File

@ -1,7 +0,0 @@
# SOGo Email Alarms
{
if (($sogod{'EMailAlarms'} || 'no') =~ m/^no$/i){
$OUT .= "# Email alarms are disabled\n# ";
}
$OUT .= "* * * * * sogo /usr/sbin/sogo-ealarms-notify\n";
}

View File

@ -0,0 +1,5 @@
{
my $version = qx(/bin/rpm -q --qf "%{version}" sogo-tool);
my $cmd = ($version =~ m/^2/) ? 'expire-autoreply' : 'update-autoreply';
$OUT = "0 0 * * * sogo /usr/sbin/sogo-tool $cmd -p /etc/sogo/sieve.creds";
}

View File

@ -0,0 +1 @@
* * * * * sogo /usr/sbin/sogo-tool expire-sessions { $sogod{SessionDuration} || '60' }

View File

@ -0,0 +1,17 @@
{
# Only enable auth cache if SOGo is using CAS
my $sogo_auth = $sogod{'Authentication'} || 'cas';
if (lc $sogo_auth eq 'cas'){
my $size = $dovecot{'AuthCacheSize'} || '5242880';
my $ttl = $dovecot{'AuthCacheTTL'} || '7200';
my $neg_ttl = $dovecot{'AuthCacheNegativeTTL'} || '0';
$OUT .=<<"EOF";
auth_cache_size = $size
auth_cache_ttl = $ttl
auth_cache_negative_ttl = $neg_ttl
EOF
}
else{
$OUT .= "# No auth cache as SOGo doesn't use CAS";
}
}

View File

@ -0,0 +1,9 @@
passdb \{
driver = passwd-file
master = yes
args = username_format=%u /etc/dovecot/master.%s.%r
\}
userdb \{
driver = passwd-file
args = username_format=%u /etc/dovecot/master.%s.%r
\}

View File

@ -0,0 +1 @@
sogo-sieve:\{plain\}{ $sogod{SieveMasterPassword} }:101:101::/home/e-smith::allow_nets=127.0.0.1/8

View File

@ -1,3 +0,0 @@
#! /bin/sh
exec mysql < /home/sogo/smeserver/sogo_mysql_create_database.sql

View File

@ -1,3 +0,0 @@
#! /bin/sh
exec mysql < /home/sogo/smeserver/sogo_mysql_update_privileges.sql

View File

@ -1,3 +0,0 @@
#! /bin/sh
exec /etc/e-smith/events/actions/sogo_upgrade

View File

@ -0,0 +1,57 @@
{
my $db = ${'sogod'}{'DbName'} || 'sogo';
my $user = ${'sogod'}{'DbUser'} || 'sogo';
my $pass = ${'sogod'}{'DbPassword'} || 'secret';
$OUT .= <<"END";
/usr/bin/mysql <<EOF
CREATE DATABASE IF NOT EXISTS $db CHARACTER SET='utf8';
USE mysql;
REPLACE INTO user (
host,
user,
password)
VALUES (
'localhost',
'$user',
PASSWORD ('$pass'));
REPLACE INTO db (
host,
db,
user,
select_priv, insert_priv, update_priv, delete_priv,
create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
grant_priv, lock_tables_priv, references_priv)
VALUES (
'localhost',
'$db',
'$user',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y',
'N', 'Y', 'Y');
FLUSH PRIVILEGES;
EOF
# Upgrade DB for 2.3.0
for TABLE in \$(/usr/bin/mysql $db -s -e "select SUBSTRING_INDEX(c_quick_location, '/', -1) from sogo_folder_info where c_path3 = 'Calendar';"); do
/usr/bin/mysql $db -e "ALTER TABLE \$TABLE MODIFY c_partstates mediumtext;"
/usr/bin/mysql $db <<EOF
DELIMITER ;;
CREATE PROCEDURE upgrade_230()
BEGIN
DECLARE CONTINUE HANDLER FOR 1060 BEGIN END;
ALTER TABLE \$TABLE ADD COLUMN c_description mediumtext;
END;;
CALL upgrade_230();;
DROP PROCEDURE upgrade_230;
EOF
done
END
}

View File

@ -2,7 +2,8 @@
{
$sogoStatus = $sogod{'status'} || "disabled";
$webmailStatus = $imp{'status'} || "disabled";
my $lib = ( -d '/usr/lib64/GNUstep/SOGo/WebServerResources' ) ? 'lib64':'lib';
$activeSync = $sogod{'ActiveSync'} || 'disabled';
$lib = ( -d '/usr/lib64/GNUstep/SOGo/WebServerResources' ) ? 'lib64':'lib';
$style = $sogod{'WebServerResources'} || '/usr/' . $lib . '/GNUstep/SOGo/WebServerResources/';
$style = '/usr/' . $lib . '/GNUstep/SOGo/WebServerResources/' unless ( -d $style);
$style =~ s#$#/# unless ( $style =~ m#/$# );
@ -10,6 +11,27 @@
$OUT = "";
}
ScriptAlias /sogo-cgi-bin /usr/share/SOGo/cgi-bin
<Directory /usr/share/SOGo/cgi-bin>
AllowOverride None
Options +ExecCGI
Order deny,allow
Allow from 127.0.0.1
</Directory>
ProxyPass /SOGo/casProxy http://localhost/sogo-cgi-bin/cas-proxy-validate
{
if ($activeSync =~ m/^enabled|on|1|yes$/i){
$OUT .=<<"HERE";
ProxyPass /Microsoft-Server-ActiveSync http://127.0.0.1:$sogod{'TCPPort'}/SOGo/Microsoft-Server-ActiveSync retry=60 connectiontimeout=5 timeout=3600
HERE
}
else {
$OUT .= "# ActiveSync is disabled\n";
}
}
ProxyPass /SOGo http://127.0.0.1:{$sogod{'TCPPort'}}/SOGo
ProxyPassReverse /SOGo http://127.0.0.1:{$sogod{'TCPPort'}}/SOGo
SetEnvIf Host (.*) REQUEST_HOST=$1
@ -27,6 +49,15 @@ RedirectMatch ^/.well-known/(caldav|carddav)$ /SOGo/dav/
AddDefaultCharset UTF-8
RequestHeader set "x-webobjects-server-url" "https://%\{REQUEST_HOST\}e/SOGo"
</Location>
<Location /SOGo/dav>
Header set Access-Control-Allow-Origin "*"
</Location>
<Location /SOGo/casProxy>
Order deny,allow
Deny from All
Allow from 127.0.0.1 {"$LocalIP";}
</Location>
Alias /.woa/WebServerResources/ {"$style";}
Alias /SOGo.woa/WebServerResources/ {"$style";}

View File

@ -0,0 +1,11 @@
{
my $auth = $sogod{'Authentication'} || 'cas';
if (lc $auth eq 'cas'){
$OUT .=<<"HERE";
auth sufficient pam_cas.so -simap://localhost -f/etc/pam_cas.conf
HERE
}
else{
return "";
}
}

View File

@ -0,0 +1,4 @@
auth required pam_nologin.so
auth include system-auth
account include system-auth
session include system-auth

View File

@ -0,0 +1,8 @@
{
$OUT = <<HERE;
#%PAM-1.0
HERE
$OUT .=
Text::Template::_load_text("/etc/e-smith/templates-default/template-begin");
}

View File

@ -0,0 +1 @@
sogo-sieve:{ $sogod{SieveMasterPassword} }

View File

@ -0,0 +1,2 @@
\{

View File

@ -0,0 +1,2 @@
SOGoMemcachedHost = "/var/run/sogo/memcached.sock";
SOGoCacheCleanupInterval = { $sogod{CacheCleanupInterval} || ($sogod{Authentication} || 'cas') ne 'internal' ? '7200' : '300' };

View File

@ -0,0 +1,5 @@
{
my $mem = $sogod{MemoryLimit};
return unless $mem;
$OUT .= " SxVMemLimit = $mem;\n";
}

View File

@ -3,9 +3,12 @@
SOGoMailingMechanism = smtp;
SOGoSMTPServer = localhost;
SOGoIMAPServer = "imap://localhost:{$imap{'TCPPort'} || '143'}";
NGImap4DisableIMAP4Pooling = NO;
NGImap4ConnectionStringSeparator = "{ ((($dovecot{SharedMailbox} || 'disabled') eq 'enabled') || (($dovecot{PublicMailbox} || 'disabled') eq 'enabled')) ? '/' : '.' }";
SOGoDraftsFolderName = {($sogod{'DraftsFolder'} || "Drafts")};
SOGoSentFolderName = {($sogod{'SentFolder'} || "Sent")};
SOGoTrashFolderName = {($sogod{'TrashFolder'} || "Trash")};
SOGoJunkFolderName = {($sogod{'JunkFolder'} || "Junk")};
SOGoMailListViewColumnsOrder = (
Flagged, Attachment, Subject, From, Unread, Date, Size
);

View File

@ -1,4 +1,4 @@
SOGoEnableEMailAlarms = {uc($sogod{'EMailAlarms'} || "no")};
SOGoEnableEMailAlarms = NO;
SOGoACLsSendEMailNotifications = {uc($sogod{'ACLsSendEMailNotifications'} || "no")};
SOGoAppointmentSendEMailNotifications = YES;
SOGoAppointmentSendEMailReceipts = YES;

View File

@ -0,0 +1,4 @@
SOGoRefreshViewCheck = "every_10_minutes";
SOGoFirstDayOfWeek = "1";
SOGoFirstWeekOfYear = "First4DayWeek";
SOGoCalendarDefaultReminder = "-PT15M";

View File

@ -55,4 +55,13 @@
type = ldap;
\}
);
{
my $auth = $sogod{'Authentication'} || 'cas';
if (lc $auth eq 'cas'){
$OUT .=<<"HERE";
SOGoAuthenticationType = cas;
SOGoCASServiceURL = "https://auth.$DomainName/cas/";
SOGoCASLogoutEnabled = YES;
HERE
}
}

View File

@ -0,0 +1,12 @@
{
if (($sogod{'ActiveSync'} || 'disabled') eq 'enabled'){
$OUT .=<<'_EOF';
SOGoMaximumPingInterval = 3540;
SOGoMaximumSyncInterval = 3540;
SOGoInternalSyncInterval = 60;
WOWatchDogRequestTimeout = 3600;
_EOF
}
}

View File

@ -0,0 +1,11 @@
{
if (($sogod{Debug} || 'disabled') =~ m/^yes|on|enabled|1$/){
$OUT .=<<'_EOF';
SOGoDebugRequests = YES;
SOGoEASDebugEnabled = YES;
ImapDebugEnabled = YES;
LDAPDebugEnabled = YES;
MySQL4DebugEnabled = YES;
_EOF
}
}

View File

@ -0,0 +1 @@
\}

View File

@ -1,10 +1,18 @@
{
use esmith::AccountsDB;
my $a = esmith::AccountsDB->open_ro || die "Couldn't open AccountsDB\n";
my $users = scalar($a->users());
my $fork = int($users/15);
$fork = 3 if ($fork < 3);
use esmith::ConfigDB;
my $fork;
if ($sogod{Workers}){
$fork = $sogod{Workers};
}
else{
my $users_per_worker = (defined $sogod{UsersPerWorker}) ? $sogod{UsersPerWorker} : (($sogod{'ActiveSync'} || 'disabled') =~ m/^enabled|on|1|yes$/i) ? 4 : 7;
my $a = esmith::AccountsDB->open_ro || die "Couldn't open AccountsDB\n";
my $users = scalar($a->users());
$fork = int($users/$users_per_worker);
$fork = 3 if ($fork < 3);
}
$OUT .= "PREFORK=$fork";

View File

@ -1,5 +0,0 @@
\{
NSGlobalDomain = \{
\};
sogod = \{

View File

@ -1 +0,0 @@
SOGoMemcachedHost = "/var/run/sogo/memcached.sock";

View File

@ -1,3 +0,0 @@
SOGoMailMessageCheck = "every_10_minutes";
SOGoFirstDayOfWeek = "1";
SOGoFirstWeekOfYear = "FirstFullWeek";

View File

@ -1,22 +0,0 @@
CONNECT mysql;
REPLACE INTO user (host, user, password)
VALUES (
'localhost',
'sogo',
password('{$sogod{DbPassword}}')
);
REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv,
delete_priv, create_priv, drop_priv, alter_priv, index_priv,
references_priv)
VALUES (
'localhost',
'sogo',
'sogo',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y',
'Y'
);
FLUSH PRIVILEGES;

View File

@ -0,0 +1,16 @@
{
$conf->{'applicationList'}->{'010apps'}->{'sogo'} = {
'options' => {
'logo' => 'mailappt.png',
'name' => 'SOGo',
'description' => 'Mails, agendas, contacts',
'uri' => "https://$host.$domain/SOGo",
'display' => 'on'
},
'type' => 'application'
} unless ($conf->{'applicationList'}->{'010apps'}->{'sogo'});
$OUT = '';
}

View File

@ -47,12 +47,6 @@ __DATA__
<description>SEND_ACL_MAIL_DESC</description>
<label>SEND_ACL_MAIL</label>
</field>
<field type="select" id="mailAlarm" options="'yes' =>
'YES', 'no' => 'NO'"
value="get_prop('EMailAlarms')">
<description>MAIL_ALARM_DESC</description>
<label>MAIL_ALARM</label>
</field>
<field type="select" id="auxAccounts" options="'yes' =>
'YES', 'no' => 'NO'"
value="get_prop('AuxiliaryUserAccounts')">

View File

@ -1,78 +0,0 @@
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE var:component>
<var:component
className="UIxPageFrame"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
const:jsFiles="PasswordPolicy.js"
const:popup="YES"
><var:string var:value="doctype" const:escapeHTML="NO"/>
<div id="aboutBox" style="display:none;">
<div>
<p class="logo"><img const:alt="SOGo" rsrc:src="sogo-logo.png"/></p>
<p>Version <var:string value="version"/> <span class="buildDate">(<var:string value="buildDate" />)</span></p>
<p class="scroll"><var:string label:value="AboutBox" const:escapeHTML="NO"/></p>
<img const:alt="Inverse" rsrc:src="inverse.png"/>
<p class="links"><a href="http://www.sogo.nu/" target="_new">www.sogo.nu</a> /
<a href="http://www.inverse.ca/" target="_new">www.inverse.ca</a></p>
<p><a id="aboutClose" href="#" class="button">
<span><var:string label:value="OK" /></span></a></p>
</div>
</div>
<div id="linkBanner" class="linkbanner">
<a id="about" href="#"><var:string label:value="About" /></a>
</div>
<form id="connectForm" var:href="connectURL">
<div id="loginScreen">
<var:if condition="hasLoginSuffix"><script
type="text/javascript">var loginSuffix = '<var:string value="loginSuffix"/>';</script
></var:if>
<table width="560">
<tr>
<td>
<img const:alt="*" id="splash" rsrc:src="/logo_ipasserelle.png"/>
</td>
<td id="loginCell" width="230">
<label><var:string label:value="Username:"/><br/>
<input class="textField" id="userName" name="userName"
type="text" var:value="cookieUsername" /></label>
<label><var:string label:value="Password:"/><br/>
<input class="textField" id="password"
name="password" type="password" var:value="password" /></label>
<label><var:string label:value="Language:"/><br/>
<var:popup const:id="language" const:name="language"
list="languages"
item="item"
var:selection="item"
var:value="item"
string="languageText"
label:noSelectionString="choose"
/></label>
<var:if condition="hasLoginDomains">
<label><var:string label:value="Domain:"/><br/>
<var:popup const:id="domain" const:name="domain"
list="loginDomains"
item="item"
var:selection="item"
var:value="item"
string="item"
/></label>
</var:if>
<label><input id="rememberLogin" type="checkbox" class="checkBox" var:checked="rememberLogin"/> <var:string label:value="Remember username"/></label>
<label>
<a href="#" class="button" id="submit" name="submit">
<span><var:string label:value="Connect" /></span></a>
</label>
</td>
</tr>
<tr><td colspan="2"><label id="animation"><!-- busy.gif! --></label></td></tr>
</table>
<p id="errorMessage"><!-- space --></p>
</div>
</form
><img const:alt="*" id="preparedAnimation" rsrc:src="busy.gif"/>
</var:component>

View File

@ -1,29 +0,0 @@
-- SOGo Database Creation
CREATE DATABASE IF NOT EXISTS `sogo`;
CONNECT `sogo`;
CREATE TABLE IF NOT EXISTS `sogo_folder_info` (
`c_folder_id` bigint(20) unsigned NOT NULL auto_increment,
`c_path` varchar(255) NOT NULL,
`c_path1` varchar(255) NOT NULL,
`c_path2` varchar(255) default NULL,
`c_path3` varchar(255) default NULL,
`c_path4` varchar(255) default NULL,
`c_foldername` varchar(255) NOT NULL,
`c_location` varchar(2048) NOT NULL,
`c_quick_location` varchar(2048) default NULL,
`c_acl_location` varchar(2048) default NULL,
`c_folder_type` varchar(255) NOT NULL,
PRIMARY KEY (`c_path`),
UNIQUE KEY `c_folder_id` (`c_folder_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `sogo_user_profile` (
`c_uid` varchar(255) NOT NULL,
`c_defaults` text,
`c_settings` text,
PRIMARY KEY (`c_uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

View File

@ -1 +0,0 @@
-- sogo_mysql_privileges.sql template

View File

@ -0,0 +1,93 @@
#!/usr/bin/python
# cas-proxy-validate.py - this file is part of SOGo
#
# Copyright (C) 2010 Inverse inc.
#
# Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# This script provides a CGI to avoid reentrancy issues when using SOGo in CAS
# mode
# debian dep: python-memcache
import cgi
import memcache
import os
import sys
config = { "cas-addr": "127.0.0.1",
"memcached-addrs": ["unix:/var/run/sogo/memcached.sock"] }
class CASProxyValidator:
def run(self):
if os.environ.has_key("GATEWAY_INTERFACE"):
self._runAsCGI()
else:
self._runAsCmd()
def _runAsCGI(self):
if self._cgiChecks():
form = cgi.FieldStorage()
if form.list == []:
message = "Empty parameters : assuming cert. validation"
self._printCGIError(message, 200)
return
if form.has_key("pgtId") and form.has_key("pgtIou"):
pgtIou = form.getfirst("pgtIou")
pgtId = form.getfirst("pgtId")
self._registerPGTIdAndIou(pgtIou, pgtId)
message = "'%s' set to '%s'" \
% ("cas-pgtiou:%s" % pgtIou, pgtId)
self._printCGIError(message, 200)
else:
self._printCGIError("Missing parameter.")
def _cgiChecks(self):
rc = False
if os.environ["REQUEST_METHOD"] == "GET":
if os.environ["REMOTE_ADDR"] == config["cas-addr"]:
rc = True
else:
self._printCGIError("Who are you? (%s)" % os.environ["REMOTE_ADDR"])
else:
self._printCGIError("Only 'GET' is accepted.")
return rc
def _printCGIError(self, message, code = 403):
print("Status: %d\n"
"Content-Type: text/plain; charset=utf-8\n\n%s"
% (code, message))
def _runAsCmd(self):
if len(sys.argv) == 3:
self._registerPGTIdAndIou(sys.argv[1], sys.argv[2])
print "set '%s' to '%s'" \
% ("cas-pgtiou:%s" % sys.argv[1], sys.argv[2])
else:
raise Exception, "Missing or too many parameters."
def _registerPGTIdAndIou(self, pgtIou, pgtId):
mc = memcache.Client(config["memcached-addrs"])
mc.set("cas-pgtiou:%s" % pgtIou, pgtId)
if __name__ == "__main__":
process = CASProxyValidator()
process.run()

View File

@ -0,0 +1,2 @@
var sogo = Services.io.newURI("https://<?php echo HOSTNAME;?>.<?php echo DOMAIN;?>/SOGo", null, null);
Services.perms.add(sogo, "popup", 1);

View File

@ -0,0 +1,52 @@
package Apache::FilterChangeLength;
use strict;
use warnings FATAL => 'all';
use Apache2::RequestRec ();
use APR::Table ();
use APR::Bucket ();
use APR::Brigade ();
use base qw(Apache2::Filter);
use Apache2::Const -compile => qw(OK);
use APR::Const -compile => ':common';
sub handler {
my ($filter, $bb) = @_;
my $ctx = $filter->ctx;
my $data = exists $ctx->{data} ? $ctx->{data} : '';
$ctx->{invoked}++;
my ($bdata, $seen_eos) = flatten_bb($bb);
$data .= $bdata if $bdata;
if ($seen_eos) {
my $len = length $data;
$filter->r->headers_out->set('Content-Length', $len);
$filter->print($data) if $data;
}
else {
# store context for all but the last invocation
$ctx->{data} = $data;
$filter->ctx($ctx);
}
return Apache2::Const::OK;
}
sub flatten_bb {
my ($bb) = shift;
my $seen_eos = 0;
my @data;
for (my $b = $bb->first; $b; $b = $bb->next($b)) {
$seen_eos++, last if $b->is_eos;
$b->read(my $bdata);
push @data, $bdata;
}
return (join('', @data), $seen_eos);
}
1;

View File

@ -107,7 +107,6 @@ sub apply {
$configdb->set_prop('sogod', 'status', $q->param("status"));
$configdb->set_prop('sogod', 'ACLsSendEMailNotifications', $q->param("aclSendMail"));
$configdb->set_prop('sogod', 'EMailAlarms', $q->param("mailAlarm"));
$configdb->set_prop('sogod', 'AuxiliaryUserAccounts', $q->param("auxAccounts"));
$configdb->set_prop('sogod', 'PublicAccess', $q->param("publicAccess"));
$configdb->set_prop('sogod', 'AllowedGroups', join(',', $q->param("allowedGroups")));

View File

@ -0,0 +1,52 @@
#!/usr/bin/perl -wT
=head1 NAME
fix_headers_case
=head1 DESCRIPTION
SOGo adds lower case headers, which some mail servers do not like.
This plugin just rewrite them to have the first letter uppercase
=head1 AUTHOR
Daniel Berteaud <daniel@firewall-services.com>
=head1 LICENSE
GNU GPL (GNU General Public License)
=cut
sub register {
my ($self, $qp, %arg) = @_;
$self->register_hook("data_post", "fix_headers_case");
}
sub fix_headers_case {
my ($self, $transaction) = @_;
my $mailer = $self->get_header($transaction,'User-Agent') or return DECLINED;
$mailer =~ m/^SOGoMail/ or return DECLINED;
$self->log(LOGINFO, "SOGo mailer detected, going to fix headers case");
foreach my $header (qw/From To Cc Subject Message-ID Content-Type Date Content-Length Content-Transfer-Encoding/){
my $value = $self->get_header($transaction,$header) or next;
$self->set_header($transaction, $header, $value);
}
return DECLINED;
}
sub get_header {
my ($self, $transaction, $header) = @_;
my $ret = $transaction->header->get($header) or return;
return $ret;
}
sub set_header {
my ($self, $transaction, $header, $value) = @_;
my $ret = $transaction->header->delete($header) or return;
$ret = $transaction->header->add($header, $value) or return;
return $ret;
}