Merge branch 'sieve-migration' into 'main'
sieve: move `cfg.sieveDirectory` into home directory of virtual users See merge request simple-nixos-mailserver/nixos-mailserver!508
This commit is contained in:
+23
-1
@@ -61,7 +61,7 @@ in
|
||||
|
||||
nodes = {
|
||||
machine =
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./../default.nix
|
||||
@@ -111,6 +111,7 @@ in
|
||||
};
|
||||
"user3@example.com" = {
|
||||
passwordFile = "/run/passwords/user3";
|
||||
sieveScript = lib.readFile ./lib/redirect.sieve;
|
||||
};
|
||||
"user4@example.com" = {
|
||||
hashedPasswordFile = hashedPasswordFileWithScheme;
|
||||
@@ -292,6 +293,27 @@ in
|
||||
)
|
||||
)
|
||||
|
||||
with subtest("user's static Sieve script is being executed"):
|
||||
# user3@example.com has a cfg.sieveScript that forwards every
|
||||
# mail sent from user1@example.com back to user1@example.com
|
||||
machine.succeed(
|
||||
" ".join(
|
||||
[
|
||||
"mail-check send-and-read",
|
||||
"--smtp-port 587",
|
||||
"--smtp-starttls",
|
||||
"--smtp-host localhost",
|
||||
"--imap-host localhost",
|
||||
"--imap-username user1@example.com",
|
||||
"--from-addr user1@example.com",
|
||||
"--to-addr user3@example.com",
|
||||
"--src-password-file ${passwordFile}",
|
||||
"--dst-password-file ${passwordFile}",
|
||||
"--ignore-dkim-spf",
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
with subtest("imap port 143 is closed and imaps is serving SSL"):
|
||||
machine.wait_for_closed_port(143)
|
||||
machine.wait_for_open_port(993)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
if address :is "from" "user1@example.com" {
|
||||
redirect "user1@example.com";
|
||||
}
|
||||
Reference in New Issue
Block a user