From f110705435a587058233ea2c5e3410c8bbd0a610 Mon Sep 17 00:00:00 2001 From: Thomas Preisner Date: Thu, 27 Mar 2025 19:29:02 +0100 Subject: [PATCH] tests: basic: Add tests whether system users can dispatch mails --- tests/basic.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/basic.nix b/tests/basic.nix index 70bd13f..cdee2ad 100644 --- a/tests/basic.nix +++ b/tests/basic.nix @@ -82,6 +82,19 @@ in I'm pretending to be someotheraddress@example.com and the mailserver should reject this attempt. ''}") + with subtest("send succeeds for system user"): + client.succeed("${sendMail "system" "" accounts."normal".address '' + Subject: Testmail2 + + Hello User1, + this is some text! + ''}") + # give the mail server some time to process the mail + server.wait_until_fails('${pendingPostqueue}') + + with subtest("mail can be retrieved via imap"): + client.succeed("${recvMail "normal"} >&2") + with subtest("mail sent to system-account is rejected"): client.fail("${sendMail "normal" "someotheraddress@example.com" accounts."system".address '' Subject: Mail to system-account