Adding hidden sieve config

This commit is contained in:
Lyes Saadi 2025-10-15 14:34:26 +02:00
parent 331b403a74
commit 4e5c7f7fe8
Signed by: lyes
GPG key ID: 55A1D803917CF39A
4 changed files with 16 additions and 8 deletions

View file

@ -48,22 +48,24 @@
];
quota = "1T";
sieveScript = ''
require ["fileinto", "regex", "variables"];
require ["include", "fileinto", "mailbox", "copy", "regex", "variables"];
include :personal "hiddensieve";
if address :is :domain "X-Original-To" "lyes.eu" {
if address :localpart :regex "X-Original-To" "^(([a-zA-Z]+\\.)*([a-zA-Z]+))(-([a-zA-Z0-9_.\\-]*))?''$" {
set "mbox_candidate" "INBOX.''${1}";
fileinto "''${mbox_candidate}";
fileinto :create "''${mbox_candidate}";
}
else {
fileinto "INBOX.other";
fileinto :create "INBOX.other";
}
}
elsif address :is "X-Original-To" "lyes@mail.lyes.eu" {
fileinto "INBOX";
fileinto :create "INBOX";
}
else {
fileinto "INBOX.other";
fileinto :create "INBOX.other";
}
'';
};
@ -115,5 +117,13 @@
owner = "postfix";
file = ../../../secrets/lyes/mail-passwd.age;
};
lyes-hidden-sieve = {
file = ../../../secrets/lyes/hidden-sieve.age;
path = "/var/sieve/lyes@mail.lyes.eu/scripts/hiddensieve.sieve";
owner = "virtualMail";
group = "virtualMail";
mode = "660";
};
};
}