pull nixos-mailserver module into this repo
This commit is contained in:
parent
0b19cc8c6a
commit
284dd09a91
23 changed files with 1077 additions and 188 deletions
30
nixos-mailserver/sieve-report-spam-ham.nix
Normal file
30
nixos-mailserver/sieve-report-spam-ham.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ stdenv, dovecot_pigeonhole}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "sieve-report-spam-ham";
|
||||
|
||||
src = ./sieve-report-spam-ham;
|
||||
|
||||
phases = [ "copyPhase" "compilePhase" ];
|
||||
|
||||
copyPhase = ''
|
||||
mkdir $out
|
||||
cp -Rv $src/. $out/
|
||||
find $out -type d -exec chmod -c 0755 {} \;
|
||||
set +x
|
||||
'';
|
||||
|
||||
# Yeah, need a specific dovecot.conf to enable the necessary plugins...
|
||||
# taking the one used by the dovecot that actually executes the sieve scripts should
|
||||
# work as well, but passing it through isn't worth my time.
|
||||
compilePhase = ''
|
||||
dc=$(pwd)/dovecot.conf
|
||||
cat > $dc <<-EOF
|
||||
plugin {
|
||||
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
||||
}
|
||||
EOF
|
||||
find $out -iname '*.sieve' -print0 | xargs -t -0 -n1 ${dovecot_pigeonhole}/bin/sievec -c $dc
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue