/[smecontribs]/rpms/smeserver-mailsorting/contribs8/smeserver-mailsorting-1.2-admin-account.patch
ViewVC logotype

Contents of /rpms/smeserver-mailsorting/contribs8/smeserver-mailsorting-1.2-admin-account.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Fri Nov 29 21:35:17 2013 UTC (10 years, 5 months ago) by unnilennium
Branch: MAIN
CVS Tags: smeserver-mailsorting-1_2-44_el5_sme, smeserver-mailsorting-1_2-45_el5_sme, smeserver-mailsorting-1_2-47_el5_sme, smeserver-mailsorting-1_2-46_el5_sme, HEAD
Changes since 1.1: +4 -4 lines
* Fri Nov 29 2013 JP Pialasse <tests@pialasse.com> 1.2-44.sme
- fix admin patch

1 diff -Nur smeserver-mailsorting-1.2-old/root/etc/cron.weekly/mailsorting smeserver-mailsorting-1.2/root/etc/cron.weekly/mailsorting
2 --- smeserver-mailsorting-1.2-old/root/etc/cron.weekly/mailsorting 2013-11-27 14:00:57.000000000 +0100
3 +++ smeserver-mailsorting-1.2/root/etc/cron.weekly/mailsorting 2013-11-27 23:49:07.000000000 +0100
4 @@ -35,7 +35,8 @@
5 my $userName = '';
6 foreach $userName (sort @userAccounts)
7 {
8 - my $path = "/home/e-smith/files/users/$userName";
9 + my $path = ($userName eq 'admin')? "/home/e-smith":"/home/e-smith/files/users/$userName";
10 +
11 foreach ('procmail','mailfilter')
12 {
13 if (-f "$path/$_.log.2")
14 diff -Nur smeserver-mailsorting-1.2-old/root/etc/e-smith/events/actions/mailsorting-update-user smeserver-mailsorting-1.2/root/etc/e-smith/events/actions/mailsorting-update-user
15 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/events/actions/mailsorting-update-user 2013-11-27 14:00:57.000000000 +0100
16 +++ smeserver-mailsorting-1.2/root/etc/e-smith/events/actions/mailsorting-update-user 2013-11-27 23:45:37.000000000 +0100
17 @@ -39,7 +39,7 @@
18 my $user = $accountsdb->get($userName);
19 die
20 "Account $userName is not a user account; update mailsorting failed.\n"
21 - unless ($user && $user->prop('type') eq "user");
22 + unless ($user && $user->prop('type') eq "user" || $userName eq "admin");
23 @users = ($user);
24 if($user->prop('geekmode') eq "enabled"){
25 print "User $userName in geek mode, do not update mailfilter and procmail rules.\n";
26 @@ -57,6 +57,8 @@
27
28 for my $dotfile ( qw(.procmailrc .mailfilter) )
29 {
30 +my $pathtohome = ($userName eq 'admin')? "/home/e-smith":"/home/e-smith/files/users/$userName";
31 +
32 esmith::templates::processTemplate (
33 {
34 MORE_DATA =>
35 @@ -69,8 +71,7 @@
36 "/etc/e-smith/templates-user-custom",
37 "/etc/e-smith/templates-user",
38 ],
39 - OUTPUT_PREFIX =>
40 - "/home/e-smith/files/users/$userName",
41 + OUTPUT_PREFIX => $pathtohome,
42 UID => $userName,
43 GID => $userName,
44 PERMS => 0600,
45 diff -Nur smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/25options smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/25options
46 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/25options 2013-11-27 14:00:57.000000000 +0100
47 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/25options 2013-11-27 23:45:37.000000000 +0100
48 @@ -13,7 +13,7 @@
49 die
50 "Account $USERNAME is not a user account; "
51 . "update email forwarding failed.\n"
52 - unless $type eq 'user';
53 + unless $type eq 'user' || $USERNAME eq 'admin';
54
55 my %processmail;
56 tie %processmail, 'esmith::config', '/home/e-smith/db/processmail';
57 @@ -42,4 +42,4 @@
58 $OUT .= "exit\n";
59 $OUT .= "\}\n";
60 }
61 -}
62 \ Pas de fin de ligne à la fin du fichier.
63 +}
64 diff -Nur smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/40global smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/40global
65 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/40global 2013-11-27 14:00:57.000000000 +0100
66 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/40global 2013-11-27 23:45:37.000000000 +0100
67 @@ -15,7 +15,7 @@
68 die
69 "Account $USERNAME is not a user account; "
70 . "update email forwarding failed.\n"
71 - unless $type eq 'user';
72 + unless $type eq 'user' || $USERNAME eq 'admin';
73
74 my %processmail;
75 tie %processmail, 'esmith::config', '/home/e-smith/db/processmail';
76 @@ -161,4 +161,4 @@
77 }
78 }#foreach rule
79 }#if rules exist
80 -}
81 \ Pas de fin de ligne à la fin du fichier.
82 +}
83 diff -Nur smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/60user smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/60user
84 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/60user 2013-11-27 14:00:57.000000000 +0100
85 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/60user 2013-11-27 23:45:37.000000000 +0100
86 @@ -15,7 +15,7 @@
87 die
88 "Account $USERNAME is not a user account; "
89 . "update email forwarding failed.\n"
90 - unless $type eq 'user';
91 + unless $type eq 'user' || $USERNAME eq 'admin';
92
93 my %processmail;
94 tie %processmail, 'esmith::config', '/home/e-smith/db/processmail';
95 @@ -161,4 +161,4 @@
96 }
97 }#foreach rule
98 }#if rules exist
99 -}
100 \ Pas de fin de ligne à la fin du fichier.
101 +}
102 diff -Nur smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.procmailrc/10header smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.procmailrc/10header
103 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.procmailrc/10header 2013-11-27 14:00:57.000000000 +0100
104 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.procmailrc/10header 2013-11-27 23:50:53.000000000 +0100
105 @@ -1,7 +1,24 @@
106 -# ---- Defaults ------------------
107 -SHELL=/bin/bash
108 -DEFAULT=$HOME/Maildir/
109 -FORMAIL=/usr/bin/formail
110 -MAILDIR=$HOME/Maildir/
111 -PMDIR=$HOME
112 -SENDMAIL=/usr/sbin/sendmail
113 +{
114 + if ($USERNAME ne 'admin')
115 + {
116 + $OUT .= "# ---- Defaults ------------------\n";
117 + $OUT .= "SHELL=/bin/bash\n";
118 + $OUT .= "DEFAULT=\$HOME/Maildir/\n";
119 + $OUT .= "FORMAIL=/usr/bin/formail\n";
120 + $OUT .= "MAILDIR=\$HOME/Maildir/\n";
121 + $OUT .= "PMDIR=\$HOME\n";
122 + $OUT .= "SENDMAIL=/usr/sbin/sendmail\n";
123 + }
124 +
125 +elsif ($USERNAME eq 'admin')
126 + {
127 + $OUT .= "# ---- Defaults ------------------\n";
128 + $OUT .= "SHELL=/bin/bash\n";
129 + $OUT .= "DEFAULT=/home/e-smith/Maildir/\n";
130 + $OUT .= "FORMAIL=/usr/bin/formail\n";
131 + $OUT .= "MAILDIR=/home/e-smith/Maildir/\n";
132 + $OUT .= "PMDIR=/home/e-smith\n";
133 + $OUT .= "SENDMAIL=/usr/sbin/sendmail\n";
134 + }
135 +}
136 +
137 diff -Nur smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.procmailrc/15log smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.procmailrc/15log
138 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.procmailrc/15log 2013-11-27 14:00:57.000000000 +0100
139 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.procmailrc/15log 2013-11-27 23:45:37.000000000 +0100
140 @@ -19,7 +19,14 @@
141 $OUT .= "\n";
142 $OUT .= "# ---- some logging------------------\n";
143 $OUT .= "VERBOSE=no\n";
144 - $OUT .= "LOGFILE=\$HOME/procmail.log\n";
145 + if ($USERNAME ne "admin")
146 + {
147 + $OUT .= "LOGFILE=\$HOME/procmail.log\n";
148 + }
149 + if ($USERNAME eq "admin")
150 + {
151 + $OUT .= "LOGFILE=/home/e-smith/procmail.log\n";
152 + }
153 }
154 else
155 {
156 @@ -27,6 +34,14 @@
157 $OUT .= "# ---- verbose, for debugging only --------------\n";
158 $OUT .= "VERBOSE=yes\n";
159 $OUT .= "LOGABSTRACT=all\n";
160 - $OUT .= "LOGFILE=\$HOME/procmail.log\n";
161 + if ($USERNAME ne "admin")
162 + {
163 + $OUT .= "LOGFILE=\$HOME/procmail.log\n";
164 + }
165 + if ($USERNAME eq "admin")
166 + {
167 + $OUT .= "LOGFILE=/home/e-smith/procmail.log\n";
168 + }
169 +
170 }
171 }
172 diff -Nur smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.qmail/50Filter smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.qmail/50Filter
173 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.qmail/50Filter 2013-11-27 14:00:57.000000000 +0100
174 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.qmail/50Filter 2013-11-27 23:45:37.000000000 +0100
175 @@ -1,12 +1,7 @@
176 {
177 if ($qmail{FilterOrder})
178 {
179 - if ($USERNAME)
180 - {
181 - return "# Procmail/Maildrop disabled for admin"
182 - if ($USERNAME eq 'admin');
183 - }
184 -
185 +
186 if ($props{MailFilter})
187 {
188 my $MailFilter = $props{MailFilter} || 'on';
189 diff -Nur smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.qmail/76Filter smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.qmail/76Filter
190 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.qmail/76Filter 2013-11-27 14:00:57.000000000 +0100
191 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.qmail/76Filter 2013-11-27 23:45:37.000000000 +0100
192 @@ -5,12 +5,7 @@
193 }
194 else
195 {
196 - if ($USERNAME)
197 - {
198 - return "# Procmail/Maildrop disabled for admin"
199 - if ($USERNAME eq 'admin');
200 - }
201 -
202 +
203 if ($props{MailFilter})
204 {
205 my $MailFilter = $props{MailFilter} || 'on';

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed