Add support for vacation scheduling using a sieve admin account
This commit is contained in:
parent
3cb2b15e1c
commit
987e0e06b4
|
@ -10,6 +10,9 @@ templates2events("/etc/sogo/sogo.conf", qw(email-update bootstrap-console-save p
|
|||
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");
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
TIME=$(/sbin/e-smith/db configuration getprop sogod SessionDuration || echo 1440)
|
||||
|
||||
# Remove old SOGo sessions entries
|
||||
su -l -s /bin/bash sogo -c "/usr/sbin/sogo-tool expire-sessions $TIME"
|
32
root/etc/e-smith/db/configuration/migrate/SOGoSievePassword
Normal file
32
root/etc/e-smith/db/configuration/migrate/SOGoSievePassword
Normal 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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
PERMS=0600
|
3
root/etc/e-smith/templates.metadata/etc/sogo/sieve.creds
Normal file
3
root/etc/e-smith/templates.metadata/etc/sogo/sieve.creds
Normal file
|
@ -0,0 +1,3 @@
|
|||
PERMS=0640
|
||||
UID="root"
|
||||
GID="sogo"
|
1
root/etc/e-smith/templates/etc/cron.d/sogo/autoreply
Normal file
1
root/etc/e-smith/templates/etc/cron.d/sogo/autoreply
Normal file
|
@ -0,0 +1 @@
|
|||
0 0 * * * sogo /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.creds
|
1
root/etc/e-smith/templates/etc/cron.d/sogo/sessions
Normal file
1
root/etc/e-smith/templates/etc/cron.d/sogo/sessions
Normal file
|
@ -0,0 +1 @@
|
|||
* * * * * sogo /usr/sbin/sogo-tool expire-sessions { $sogod{SessionDuration} || '60' }
|
|
@ -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
|
||||
\}
|
|
@ -0,0 +1 @@
|
|||
sogo-sieve:\{plain\}{ $sogod{SieveMasterPassword} }:101:101::/home/e-smith::allow_nets=127.0.0.1/8
|
1
root/etc/e-smith/templates/etc/sogo/sieve.creds/sogo
Normal file
1
root/etc/e-smith/templates/etc/sogo/sieve.creds/sogo
Normal file
|
@ -0,0 +1 @@
|
|||
sogo-sieve:{ $sogod{SieveMasterPassword} }
|
Loading…
Reference in New Issue
Block a user