Adding sieve & nullmailer
This commit is contained in:
parent
8fb4bf2858
commit
1898f95ac8
5 changed files with 48 additions and 7 deletions
|
|
@ -1,6 +1,10 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./nullmailer.nix
|
||||
];
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
boot.swraid = {
|
||||
|
|
|
|||
17
modules/server/nullmailer.nix
Normal file
17
modules/server/nullmailer.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.nullmailer = {
|
||||
enable = true;
|
||||
|
||||
setSendmail = true;
|
||||
config = {
|
||||
remotes = ''
|
||||
taf.lyes.eu smtp
|
||||
'';
|
||||
adminaddr = "root@lyes.eu";
|
||||
defaulthost = "lyes.eu";
|
||||
allmailfrom = "root@lyes.eu";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -46,6 +46,26 @@
|
|||
aliases = [
|
||||
"@lyes.eu"
|
||||
];
|
||||
quota = "1T";
|
||||
sieveScript = ''
|
||||
require ["fileinto", "regex", "variables"];
|
||||
|
||||
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}";
|
||||
}
|
||||
else {
|
||||
fileinto "INBOX.other";
|
||||
}
|
||||
}
|
||||
elsif address :is "X-Original-To" "lyes@mail.lyes.eu" {
|
||||
fileinto "INBOX";
|
||||
}
|
||||
else {
|
||||
fileinto "INBOX.other";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue