Actually reject mails sent to system accounts and add respective testcase
This commit is contained in:
parent
55183f5585
commit
30532bbfca
3 changed files with 30 additions and 0 deletions
|
|
@ -9,6 +9,11 @@ with (import ./common/lib.nix {inherit pkgs;}); let
|
|||
address = "user2@example.com";
|
||||
password = "secret-password2";
|
||||
};
|
||||
"system" = {
|
||||
address = "system@example.com";
|
||||
password = "secret-password3";
|
||||
isSystemUser = true;
|
||||
};
|
||||
};
|
||||
in
|
||||
pkgs.nixosTest {
|
||||
|
|
@ -77,6 +82,14 @@ in
|
|||
I'm pretending to be someotheraddress@example.com and the mailserver should reject this attempt.
|
||||
''}")
|
||||
|
||||
with subtest("mail sent to system-account is rejected"):
|
||||
client.fail("${sendMail "normal" "someotheraddress@example.com" accounts."system".address ''
|
||||
Subject: Mail to system-account
|
||||
|
||||
Hello System user,
|
||||
this mail should never reach you as it should be rejected by postfix.
|
||||
''}")
|
||||
|
||||
with subtest("server issues no warnings nor errors"):
|
||||
${checkLogs "server"}
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue