Merge pull request #21864 from pjones/pjones/dovecot
dovecot: Fix sieve scripts
This commit is contained in:
commit
28093e42ec
@ -241,6 +241,9 @@ in
|
|||||||
RuntimeDirectory = [ "dovecot2" ];
|
RuntimeDirectory = [ "dovecot2" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# When copying sieve scripts preserve the original time stamp
|
||||||
|
# (should be 0) so that the compiled sieve script is newer than
|
||||||
|
# the source file and Dovecot won't try to compile it.
|
||||||
preStart = ''
|
preStart = ''
|
||||||
rm -rf ${stateDir}/sieve
|
rm -rf ${stateDir}/sieve
|
||||||
'' + optionalString (cfg.sieveScripts != {}) ''
|
'' + optionalString (cfg.sieveScripts != {}) ''
|
||||||
@ -248,11 +251,11 @@ in
|
|||||||
${concatStringsSep "\n" (mapAttrsToList (to: from: ''
|
${concatStringsSep "\n" (mapAttrsToList (to: from: ''
|
||||||
if [ -d '${from}' ]; then
|
if [ -d '${from}' ]; then
|
||||||
mkdir '${stateDir}/sieve/${to}'
|
mkdir '${stateDir}/sieve/${to}'
|
||||||
cp "${from}/"*.sieve '${stateDir}/sieve/${to}'
|
cp -p "${from}/"*.sieve '${stateDir}/sieve/${to}'
|
||||||
else
|
else
|
||||||
cp '${from}' '${stateDir}/sieve/${to}'
|
cp -p '${from}' '${stateDir}/sieve/${to}'
|
||||||
fi
|
fi
|
||||||
${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/sieve/${to}'
|
${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/sieve/${to}'
|
||||||
'') cfg.sieveScripts)}
|
'') cfg.sieveScripts)}
|
||||||
chown -R '${cfg.mailUser}:${cfg.mailGroup}' '${stateDir}/sieve'
|
chown -R '${cfg.mailUser}:${cfg.mailGroup}' '${stateDir}/sieve'
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user