diff -Nur smeserver-mailsorting-1.2-old/root/etc/cron.weekly/mailsorting smeserver-mailsorting-1.2/root/etc/cron.weekly/mailsorting --- smeserver-mailsorting-1.2-old/root/etc/cron.weekly/mailsorting 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/cron.weekly/mailsorting 2013-11-27 23:49:07.000000000 +0100 @@ -35,7 +35,8 @@ my $userName = ''; foreach $userName (sort @userAccounts) { - my $path = "/home/e-smith/files/users/$userName"; + my $path = ($userName eq 'admin')? "/home/e-smith":"/home/e-smith/files/users/$userName"; + foreach ('procmail','mailfilter') { if (-f "$path/$_.log.2") 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 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/events/actions/mailsorting-update-user 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/events/actions/mailsorting-update-user 2013-11-27 23:45:37.000000000 +0100 @@ -39,7 +39,7 @@ my $user = $accountsdb->get($userName); die "Account $userName is not a user account; update mailsorting failed.\n" - unless ($user && $user->prop('type') eq "user"); + unless ($user && $user->prop('type') eq "user" || $userName eq "admin"); @users = ($user); if($user->prop('geekmode') eq "enabled"){ print "User $userName in geek mode, do not update mailfilter and procmail rules.\n"; @@ -57,6 +57,8 @@ for my $dotfile ( qw(.procmailrc .mailfilter) ) { +my $pathtohome = ($userName eq 'admin')? "/home/e-smith":"/home/e-smith/files/users/$userName"; + esmith::templates::processTemplate ( { MORE_DATA => @@ -69,8 +71,7 @@ "/etc/e-smith/templates-user-custom", "/etc/e-smith/templates-user", ], - OUTPUT_PREFIX => - "/home/e-smith/files/users/$userName", + OUTPUT_PREFIX => $pathtohome, UID => $userName, GID => $userName, PERMS => 0600, 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 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/25options 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/25options 2013-11-27 23:45:37.000000000 +0100 @@ -13,7 +13,7 @@ die "Account $USERNAME is not a user account; " . "update email forwarding failed.\n" - unless $type eq 'user'; + unless $type eq 'user' || $USERNAME eq 'admin'; my %processmail; tie %processmail, 'esmith::config', '/home/e-smith/db/processmail'; @@ -42,4 +42,4 @@ $OUT .= "exit\n"; $OUT .= "\}\n"; } -} \ Pas de fin de ligne à la fin du fichier. +} 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 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/40global 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/40global 2013-11-27 23:45:37.000000000 +0100 @@ -15,7 +15,7 @@ die "Account $USERNAME is not a user account; " . "update email forwarding failed.\n" - unless $type eq 'user'; + unless $type eq 'user' || $USERNAME eq 'admin'; my %processmail; tie %processmail, 'esmith::config', '/home/e-smith/db/processmail'; @@ -161,4 +161,4 @@ } }#foreach rule }#if rules exist -} \ Pas de fin de ligne à la fin du fichier. +} 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 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.mailfilter/60user 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.mailfilter/60user 2013-11-27 23:45:37.000000000 +0100 @@ -15,7 +15,7 @@ die "Account $USERNAME is not a user account; " . "update email forwarding failed.\n" - unless $type eq 'user'; + unless $type eq 'user' || $USERNAME eq 'admin'; my %processmail; tie %processmail, 'esmith::config', '/home/e-smith/db/processmail'; @@ -161,4 +161,4 @@ } }#foreach rule }#if rules exist -} \ Pas de fin de ligne à la fin du fichier. +} 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 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.procmailrc/10header 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.procmailrc/10header 2013-11-27 23:50:53.000000000 +0100 @@ -1,7 +1,24 @@ -# ---- Defaults ------------------ -SHELL=/bin/bash -DEFAULT=$HOME/Maildir/ -FORMAIL=/usr/bin/formail -MAILDIR=$HOME/Maildir/ -PMDIR=$HOME -SENDMAIL=/usr/sbin/sendmail +{ + if ($USERNAME ne 'admin') + { + $OUT .= "# ---- Defaults ------------------\n"; + $OUT .= "SHELL=/bin/bash\n"; + $OUT .= "DEFAULT=\$HOME/Maildir/\n"; + $OUT .= "FORMAIL=/usr/bin/formail\n"; + $OUT .= "MAILDIR=\$HOME/Maildir/\n"; + $OUT .= "PMDIR=\$HOME\n"; + $OUT .= "SENDMAIL=/usr/sbin/sendmail\n"; + } + +elsif ($USERNAME eq 'admin') + { + $OUT .= "# ---- Defaults ------------------\n"; + $OUT .= "SHELL=/bin/bash\n"; + $OUT .= "DEFAULT=/home/e-smith/Maildir/\n"; + $OUT .= "FORMAIL=/usr/bin/formail\n"; + $OUT .= "MAILDIR=/home/e-smith/Maildir/\n"; + $OUT .= "PMDIR=/home/e-smith\n"; + $OUT .= "SENDMAIL=/usr/sbin/sendmail\n"; + } +} + 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 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.procmailrc/15log 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.procmailrc/15log 2013-11-27 23:45:37.000000000 +0100 @@ -19,7 +19,14 @@ $OUT .= "\n"; $OUT .= "# ---- some logging------------------\n"; $OUT .= "VERBOSE=no\n"; - $OUT .= "LOGFILE=\$HOME/procmail.log\n"; + if ($USERNAME ne "admin") + { + $OUT .= "LOGFILE=\$HOME/procmail.log\n"; + } + if ($USERNAME eq "admin") + { + $OUT .= "LOGFILE=/home/e-smith/procmail.log\n"; + } } else { @@ -27,6 +34,14 @@ $OUT .= "# ---- verbose, for debugging only --------------\n"; $OUT .= "VERBOSE=yes\n"; $OUT .= "LOGABSTRACT=all\n"; - $OUT .= "LOGFILE=\$HOME/procmail.log\n"; + if ($USERNAME ne "admin") + { + $OUT .= "LOGFILE=\$HOME/procmail.log\n"; + } + if ($USERNAME eq "admin") + { + $OUT .= "LOGFILE=/home/e-smith/procmail.log\n"; + } + } } 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 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.qmail/50Filter 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.qmail/50Filter 2013-11-27 23:45:37.000000000 +0100 @@ -1,12 +1,7 @@ { if ($qmail{FilterOrder}) { - if ($USERNAME) - { - return "# Procmail/Maildrop disabled for admin" - if ($USERNAME eq 'admin'); - } - + if ($props{MailFilter}) { my $MailFilter = $props{MailFilter} || 'on'; 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 --- smeserver-mailsorting-1.2-old/root/etc/e-smith/templates-user/.qmail/76Filter 2013-11-27 14:00:57.000000000 +0100 +++ smeserver-mailsorting-1.2/root/etc/e-smith/templates-user/.qmail/76Filter 2013-11-27 23:45:37.000000000 +0100 @@ -5,12 +5,7 @@ } else { - if ($USERNAME) - { - return "# Procmail/Maildrop disabled for admin" - if ($USERNAME eq 'admin'); - } - + if ($props{MailFilter}) { my $MailFilter = $props{MailFilter} || 'on';