tests: test mailserver.loginAccounts.<name>.sieveScript
This commit is contained in:
+23
-1
@@ -61,7 +61,7 @@ in
|
|||||||
|
|
||||||
nodes = {
|
nodes = {
|
||||||
machine =
|
machine =
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./../default.nix
|
./../default.nix
|
||||||
@@ -111,6 +111,7 @@ in
|
|||||||
};
|
};
|
||||||
"user3@example.com" = {
|
"user3@example.com" = {
|
||||||
passwordFile = "/run/passwords/user3";
|
passwordFile = "/run/passwords/user3";
|
||||||
|
sieveScript = lib.readFile ./lib/redirect.sieve;
|
||||||
};
|
};
|
||||||
"user4@example.com" = {
|
"user4@example.com" = {
|
||||||
hashedPasswordFile = hashedPasswordFileWithScheme;
|
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"):
|
with subtest("imap port 143 is closed and imaps is serving SSL"):
|
||||||
machine.wait_for_closed_port(143)
|
machine.wait_for_closed_port(143)
|
||||||
machine.wait_for_open_port(993)
|
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