From 23d06c96651fb561eabc172317540b4be9ec13d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 3 Mar 2018 11:20:28 +0100 Subject: [PATCH 1/2] Add test for #94 Ensure that no warnings or errors are in the journal --- tests/extern.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/extern.nix b/tests/extern.nix index f29acc2..32af471 100644 --- a/tests/extern.nix +++ b/tests/extern.nix @@ -249,5 +249,12 @@ import { }; + subtest "no warnings or errors", sub { + $server->fail("journalctl -u postfix | grep -i error"); + $server->fail("journalctl -u postfix | grep -i warning"); + $server->fail("journalctl -u dovecot2 | grep -i error"); + $server->fail("journalctl -u dovecot2 | grep -i warning"); + }; + ''; } From f9820b55abcb68fa756789b8c394d22ace89d5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 3 Mar 2018 11:43:42 +0100 Subject: [PATCH 2/2] Don't include identity twice in vaccounts fixes #94 --- mail-server/postfix.nix | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/mail-server/postfix.nix b/mail-server/postfix.nix index c859a49..94cfc62 100644 --- a/mail-server/postfix.nix +++ b/mail-server/postfix.nix @@ -53,12 +53,6 @@ let # all_valiases_postfix :: [ String ] all_valiases_postfix = valiases_postfix ++ extra_valiases_postfix; - # accountToIdentity :: User -> String - accountToIdentity = account: "${account.name} ${account.name}"; - - # vaccounts_identity :: [ String ] - vaccounts_identity = map accountToIdentity (lib.attrValues cfg.loginAccounts); - # valiases_file :: Path valiases_file = builtins.toFile "valias" (lib.concatStringsSep "\n" (all_valiases_postfix ++ @@ -71,10 +65,9 @@ let # see # https://blog.grimneko.de/2011/12/24/a-bunch-of-tips-for-improving-your-postfix-setup/ # for details on how this file looks. By using the same file as valiases, - # every alias is owned (uniquely) by its user. We have to add the users own - # address though - vaccounts_file = builtins.toFile "vaccounts" (lib.concatStringsSep "\n" - (vaccounts_identity ++ all_valiases_postfix)); + # every alias is owned (uniquely) by its user. + # The user's own address is already in all_valiases_postfix. + vaccounts_file = builtins.toFile "vaccounts" (lib.concatStringsSep "\n" all_valiases_postfix); submissionHeaderCleanupRules = pkgs.writeText "submission_header_cleanup_rules" '' # Removes sensitive headers from mails handed in via the submission port.