Add a BCC to service account mails to enable threading #123
1 changed files with 24 additions and 24 deletions
|
@ -92,7 +92,7 @@ with lib; let
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
configFile =
|
sieveConfigFile =
|
||||||
# https://doc.dovecot.org/configuration_manual/sieve/examples/#plus-addressed-mail-filtering
|
# https://doc.dovecot.org/configuration_manual/sieve/examples/#plus-addressed-mail-filtering
|
||||||
pkgs.writeText "basic_sieve"
|
pkgs.writeText "basic_sieve"
|
||||||
''
|
''
|
||||||
|
@ -105,32 +105,32 @@ with lib; let
|
||||||
|
|
||||||
# this should be close to teh last step
|
# this should be close to teh last step
|
||||||
if allof (
|
if allof (
|
||||||
address :localpart ["To"] ["${toString create_config_to}"],
|
address :localpart ["To"] ["${toString create_config_to}"],
|
||||||
address :domain ["To"] "skynet.ie"
|
address :domain ["To"] "skynet.ie"
|
||||||
){
|
){
|
||||||
if address :matches ["To"] "*@skynet.ie" {
|
if address :matches ["To"] "*@skynet.ie" {
|
||||||
if header :is "X-Spam" "Yes" {
|
if header :is "X-Spam" "Yes" {
|
||||||
fileinto :create "''${1}.Junk";
|
fileinto :create "''${1}.Junk";
|
||||||
stop;
|
stop;
|
||||||
} else {
|
} else {
|
||||||
fileinto :create "''${1}";
|
fileinto :create "''${1}";
|
||||||
stop;
|
stop;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if allof (
|
if allof (
|
||||||
address :localpart ["From"] ["${toString create_config_to}"],
|
address :localpart ["From"] ["${toString create_config_to}"],
|
||||||
address :domain ["From"] "skynet.ie"
|
address :domain ["From"] "skynet.ie"
|
||||||
){
|
){
|
||||||
if address :matches ["From"] "*@skynet.ie" {
|
if address :matches ["From"] "*@skynet.ie" {
|
||||||
if header :is "X-Spam" "Yes" {
|
if header :is "X-Spam" "Yes" {
|
||||||
fileinto :create "''${1}.Junk";
|
fileinto :create "''${1}.Junk";
|
||||||
stop;
|
stop;
|
||||||
} else {
|
} else {
|
||||||
fileinto :create "''${1}";
|
fileinto :create "''${1}";
|
||||||
stop;
|
stop;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
@ -477,7 +477,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
services.dovecot2.sieve.scripts = {
|
services.dovecot2.sieve.scripts = {
|
||||||
before = configFile;
|
before = sieveConfigFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
# This is to add a bcc to outgoing mail
|
# This is to add a bcc to outgoing mail
|
||||||
|
|
Loading…
Reference in a new issue