parent
3cb2b15e1c
commit
987e0e06b4
12 changed files with 52 additions and 6 deletions
@ -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" |
@ -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 |
@ -0,0 +1,3 @@ |
||||
PERMS=0640 |
||||
UID="root" |
||||
GID="sogo" |
@ -0,0 +1 @@ |
||||
0 0 * * * sogo /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.creds |
@ -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 |
@ -0,0 +1 @@ |
||||
sogo-sieve:{ $sogod{SieveMasterPassword} } |
Loading…
Reference in new issue