1 |
diff -Nur smeserver-dovecot-1.4.0/createlinks smeserver-dovecot-1.4.0_remove_extras/createlinks |
2 |
--- smeserver-dovecot-1.4.0/createlinks 2013-02-26 18:57:10.000000000 +0100 |
3 |
+++ smeserver-dovecot-1.4.0_remove_extras/createlinks 2013-02-28 17:40:32.186528985 +0100 |
4 |
@@ -20,7 +20,4 @@ |
5 |
|
6 |
event_link("adjust-dovecot", "email-update", "02"); |
7 |
event_link("adjust-dovecot", "bootstrap-console-save", "02"); |
8 |
-event_link("dovecot-acl", "email-update", "85"); |
9 |
-event_link("dovecot-acl", "user-create", "85"); |
10 |
|
11 |
-safe_touch("root/home/e-smith/db/dovecot/sharedmailbox.db"); |
12 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/db/configuration/defaults/sieve/access smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/db/configuration/defaults/sieve/access |
13 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/db/configuration/defaults/sieve/access 2013-02-26 18:57:10.000000000 +0100 |
14 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/db/configuration/defaults/sieve/access 1970-01-01 01:00:00.000000000 +0100 |
15 |
@@ -1 +0,0 @@ |
16 |
-private |
17 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/db/configuration/defaults/sieve/status smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/db/configuration/defaults/sieve/status |
18 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/db/configuration/defaults/sieve/status 2013-02-26 18:57:10.000000000 +0100 |
19 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/db/configuration/defaults/sieve/status 1970-01-01 01:00:00.000000000 +0100 |
20 |
@@ -1 +0,0 @@ |
21 |
-enabled |
22 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/db/configuration/defaults/sieve/TCPPort smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/db/configuration/defaults/sieve/TCPPort |
23 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/db/configuration/defaults/sieve/TCPPort 2013-02-26 18:57:10.000000000 +0100 |
24 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/db/configuration/defaults/sieve/TCPPort 1970-01-01 01:00:00.000000000 +0100 |
25 |
@@ -1 +0,0 @@ |
26 |
-4190 |
27 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/db/configuration/defaults/sieve/type smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/db/configuration/defaults/sieve/type |
28 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/db/configuration/defaults/sieve/type 2013-02-26 18:57:10.000000000 +0100 |
29 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/db/configuration/defaults/sieve/type 1970-01-01 01:00:00.000000000 +0100 |
30 |
@@ -1 +0,0 @@ |
31 |
-service |
32 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/events/actions/dovecot-acl smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/events/actions/dovecot-acl |
33 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/events/actions/dovecot-acl 2013-02-26 18:57:10.000000000 +0100 |
34 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/events/actions/dovecot-acl 1970-01-01 01:00:00.000000000 +0100 |
35 |
@@ -1,89 +0,0 @@ |
36 |
-#!/usr/bin/perl -w |
37 |
- |
38 |
- |
39 |
-use esmith::ConfigDB; |
40 |
-use esmith::AccountsDB; |
41 |
-use File::Find; |
42 |
- |
43 |
-my $c = esmith::ConfigDB->open || die "Couldn't open ConfigDB\n"; |
44 |
-my $a = esmith::AccountsDB->open_ro || die "Couldn't open AccountsdDB\n"; |
45 |
- |
46 |
-my $dovecot = $c->get('dovecot'); |
47 |
- |
48 |
-die "couldn't find dovecot service\n" unless ($dovecot); |
49 |
- |
50 |
-my $event = $ARGV[0]; |
51 |
- |
52 |
-# SharedMailboxes disabled ? |
53 |
-if (($dovecot->prop('SharedMailbox') || 'disabled') eq 'disabled'){ |
54 |
- if (($dovecot->prop('SharedMailboxAcl') || 'yes') ne 'no'){ |
55 |
- foreach my $user ($a->users){ |
56 |
- my $name = $user->key; |
57 |
- die "Error removing SharedMailbox ACLs ($name"."'s Maildir)\n" unless ( |
58 |
- system('/usr/bin/setfacl', |
59 |
- '-R', |
60 |
- '-x', |
61 |
- 'g:sharedmailbox', |
62 |
- "/home/e-smith/files/users/$name") == 0 && |
63 |
- system('/bin/chmod', |
64 |
- '-R', |
65 |
- 'g-s', |
66 |
- "/home/e-smith/files/users/$name/Maildir") == 0 |
67 |
- ); |
68 |
- } |
69 |
- } |
70 |
- $dovecot->set_prop('SharedMailboxAcl','no'); |
71 |
- exit(0); |
72 |
-} |
73 |
- |
74 |
-# If SharedMailbox is enabled |
75 |
- |
76 |
-# Set the correct ACL during user creation |
77 |
-if ($event && $event eq 'user-create'){ |
78 |
- my $user = $ARGV[1]; |
79 |
- set_acl($user); |
80 |
-} |
81 |
- |
82 |
-if (($dovecot->prop('SharedMailboxAcl') || 'no') ne 'yes'){ |
83 |
- # ACL for existing users haven't been set yet |
84 |
- foreach my $user ($a->users){ |
85 |
- my $name = $user->key; |
86 |
- set_acl($name); |
87 |
- } |
88 |
- $dovecot->set_prop('SharedMailboxAcl','yes'); |
89 |
-} |
90 |
- |
91 |
-# Set ACL on a user's Maildir |
92 |
-sub set_acl { |
93 |
- my $user = shift; |
94 |
- die "Missing username\n" unless ($user); |
95 |
- die "Couldn't find $user"."'s home dir\n" unless (-e "/home/e-smith/files/users/$user"); |
96 |
- find(\&dirperm, "/home/e-smith/files/users/$user/Maildir"); |
97 |
- die "Error applying permissions to $user 's Maildir\n" unless ( |
98 |
- # sharedmailbox group needs read / write access on Maildir |
99 |
- system('/usr/bin/setfacl', |
100 |
- '-R', |
101 |
- '-m', |
102 |
- 'u::rwX,g::rwX,g:sharedmailbox:rwX,d:u::rwX,d:g::rwX,d:g:sharedmailbox:rwX', |
103 |
- "/home/e-smith/files/users/$user/Maildir") == 0 && |
104 |
- # Grant sharedmailbox group permission to go through |
105 |
- # the home dir so it can access the Maildir, but don't let it read |
106 |
- # anything (except the Maildir) |
107 |
- system('/usr/bin/setfacl', |
108 |
- '-m', |
109 |
- 'g:sharedmailbox:x', |
110 |
- "/home/e-smith/files/users/$user") == 0 |
111 |
- ); |
112 |
-} |
113 |
- |
114 |
-# The kernel will handle group perms when a user |
115 |
-# create a dir in another user's Maildir (if IMAP ACL allows it) |
116 |
-# This will prevent dovecot errors, see |
117 |
-# http://wiki2.dovecot.org/SharedMailboxes/Permissions and |
118 |
-# http://wiki2.dovecot.org/Errors/ChgrpNoPerm |
119 |
-sub dirperm { |
120 |
- system('/bin/chmod', |
121 |
- 'g+s', |
122 |
- "$_") if (-d); |
123 |
-} |
124 |
- |
125 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/10protocols smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/10protocols |
126 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/10protocols 2013-02-26 18:57:10.000000000 +0100 |
127 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/10protocols 1970-01-01 01:00:00.000000000 +0100 |
128 |
@@ -1,9 +0,0 @@ |
129 |
-protocols = { |
130 |
- if ((($imap{'status'} || 'disabled') eq 'enabled') || |
131 |
- (($imaps{'status'} || 'disabled') eq 'enabled')){ |
132 |
- $OUT .= "imap"; |
133 |
- } |
134 |
- if (($sieve{'status'} || 'disabled') eq 'enabled'){ |
135 |
- $OUT .= " sieve"; |
136 |
- } |
137 |
-} |
138 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/10protocols10Imap smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/10protocols10Imap |
139 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/10protocols10Imap 1970-01-01 01:00:00.000000000 +0100 |
140 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/10protocols10Imap 2013-02-28 17:40:14.950415603 +0100 |
141 |
@@ -0,0 +1,8 @@ |
142 |
+{ |
143 |
+our $proto = ''; |
144 |
+if ((($imap{'status'} || 'disabled') eq 'enabled') || |
145 |
+ (($imaps{'status'} || 'disabled') eq 'enabled')){ |
146 |
+ $proto .= "imap"; |
147 |
+} |
148 |
+$OUT .= ""; |
149 |
+} |
150 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/11protocols smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/11protocols |
151 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/11protocols 1970-01-01 01:00:00.000000000 +0100 |
152 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/11protocols 2013-02-28 17:40:14.446451195 +0100 |
153 |
@@ -0,0 +1 @@ |
154 |
+protocols = {$proto} |
155 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/30listener smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/30listener |
156 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/30listener 2013-02-26 18:57:10.000000000 +0100 |
157 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/30listener 2013-02-28 17:40:14.723104393 +0100 |
158 |
@@ -21,19 +21,3 @@ |
159 |
|
160 |
\} |
161 |
|
162 |
-{ |
163 |
-if (($sieve{'status'} || 'enabled') eq 'enabled'){ |
164 |
- my $port = $sieve{'TCPPort'} || '4190'; |
165 |
- my $address = $sieve{'Listen'} || '127.0.0.1'; |
166 |
- $OUT .=<<"HERE"; |
167 |
- |
168 |
-service managesieve-login { |
169 |
- inet_listener sieve { |
170 |
- port = $port |
171 |
- address = $address |
172 |
- } |
173 |
-} |
174 |
- |
175 |
-HERE |
176 |
-} |
177 |
-} |
178 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/40lda smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/40lda |
179 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/40lda 2013-02-26 18:57:10.000000000 +0100 |
180 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/40lda 1970-01-01 01:00:00.000000000 +0100 |
181 |
@@ -1,19 +0,0 @@ |
182 |
- |
183 |
-postmaster_address = postmaster@{$DomainName} |
184 |
-lda_original_recipient_header = to |
185 |
- |
186 |
-{ |
187 |
-my $reason = $dovecot{'RejectMessage'} || ''; |
188 |
-my $subject = $dovecot{'RejectSubject'} || ''; |
189 |
-if ($reason ne ''){ |
190 |
- $OUT .= "rejection_reason = $reason\n"; |
191 |
-} |
192 |
-if ($subject ne ''){ |
193 |
- $OUT .= "rejection_subject = $subject\n"; |
194 |
-} |
195 |
-} |
196 |
- |
197 |
-protocol lda \{ |
198 |
- mail_plugins = $mail_plugins {$OUT .= (($sieve{'status'} || 'disabled') eq 'enabled') ? 'sieve':''} |
199 |
-\} |
200 |
- |
201 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/65pluginAcl smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/65pluginAcl |
202 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/65pluginAcl 2013-02-26 18:57:10.000000000 +0100 |
203 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates/etc/dovecot/dovecot.conf/65pluginAcl 1970-01-01 01:00:00.000000000 +0100 |
204 |
@@ -1,68 +0,0 @@ |
205 |
-{ |
206 |
-return "" if (($dovecot{'SharedMailbox'} || 'disabled') eq 'disabled'); |
207 |
- |
208 |
-push @plugins, 'acl'; |
209 |
-push @imap_plugins, 'imap_acl'; |
210 |
- |
211 |
-my $string =<<'HERE'; |
212 |
- |
213 |
-mail_access_groups = sharedmailbox |
214 |
- |
215 |
-service dict { |
216 |
- unix_listener dict { |
217 |
- mode = 0660 |
218 |
- group = sharedmailbox |
219 |
- } |
220 |
-} |
221 |
- |
222 |
-service auth { |
223 |
- unix_listener auth-userdb { |
224 |
- mode = 0660 |
225 |
- group = sharedmailbox |
226 |
- } |
227 |
-} |
228 |
- |
229 |
-service imap { |
230 |
- executable = imap imap-postlogin |
231 |
-} |
232 |
- |
233 |
-service imap-postlogin { |
234 |
- executable = script-login -d /usr/bin/imap-postlogin |
235 |
- unix_listener imap-postlogin { |
236 |
- } |
237 |
-} |
238 |
- |
239 |
- |
240 |
-namespace { |
241 |
- type = private |
242 |
- separator = / |
243 |
- prefix = |
244 |
- inbox = yes |
245 |
-} |
246 |
- |
247 |
-namespace { |
248 |
- type = shared |
249 |
- separator = / |
250 |
- prefix = shared/%%u/ |
251 |
- location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u |
252 |
- subscriptions = no |
253 |
- list = children |
254 |
-} |
255 |
- |
256 |
-plugin { |
257 |
- acl_shared_dict = file:/home/e-smith/db/dovecot/sharedmailbox.db |
258 |
-} |
259 |
- |
260 |
-plugin { |
261 |
- acl = vfile |
262 |
-} |
263 |
- |
264 |
-plugin { |
265 |
- acl_anyone = allow |
266 |
-} |
267 |
- |
268 |
-HERE |
269 |
- |
270 |
-push @conf, $string; |
271 |
-$OUT .= ''; |
272 |
-} |
273 |
diff -Nur smeserver-dovecot-1.4.0/root/etc/e-smith/templates-user/.qmail/80DovecotLDA smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates-user/.qmail/80DovecotLDA |
274 |
--- smeserver-dovecot-1.4.0/root/etc/e-smith/templates-user/.qmail/80DovecotLDA 2013-02-26 18:57:10.000000000 +0100 |
275 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/etc/e-smith/templates-user/.qmail/80DovecotLDA 1970-01-01 01:00:00.000000000 +0100 |
276 |
@@ -1,20 +0,0 @@ |
277 |
-# Dovecot LDA delivery |
278 |
-{ |
279 |
- # vim: ft=perl: |
280 |
- use esmith::ConfigDB; |
281 |
- my $cdb = esmith::ConfigDB->open_ro || die "Couldn't open ConfigDB\n"; |
282 |
- my $sieve = $cdb->get('sieve'); |
283 |
- my $usersieve = $props{Sieve} || 'enabled'; |
284 |
- my $globalsieve = ($sieve) ? ($sieve->prop('status') || 'disabled') : 'disabled'; |
285 |
- |
286 |
- if (($usersieve ne 'enabled') || ($globalsieve ne 'enabled')){ |
287 |
- $OUT .= "# Sieve is disabled\n"; |
288 |
- } |
289 |
- elsif ($props{EmailForward} !~ /^(local|both)$/) { |
290 |
- $OUT .= "# No local delivery (Dovecot LDA)\n"; |
291 |
- } |
292 |
- else{ |
293 |
- $OUT .= '| /var/qmail/bin/preline -f /usr/libexec/dovecot/dovecot-lda -a "$RECIPIENT"; if [ $? -ne 0 ] ; then exit -1; else exit 99; fi;'; |
294 |
- } |
295 |
-} |
296 |
- |
297 |
diff -Nur smeserver-dovecot-1.4.0/root/usr/bin/imap-postlogin smeserver-dovecot-1.4.0_remove_extras/root/usr/bin/imap-postlogin |
298 |
--- smeserver-dovecot-1.4.0/root/usr/bin/imap-postlogin 2013-02-26 18:57:10.000000000 +0100 |
299 |
+++ smeserver-dovecot-1.4.0_remove_extras/root/usr/bin/imap-postlogin 1970-01-01 01:00:00.000000000 +0100 |
300 |
@@ -1,5 +0,0 @@ |
301 |
-#!/bin/sh |
302 |
-ACL_GROUPS=`groups $USER | tr ' ' ','` |
303 |
-export ACL_GROUPS |
304 |
-export USERDB_KEYS="$USERDB_KEYS acl_groups" |
305 |
-exec "$@" |