From b98654f99abdf504295a2ee650b47f66620d33df Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Thu, 14 Sep 2017 10:56:22 +0200 Subject: [PATCH] fixes #9 --- mail-server/postfix.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mail-server/postfix.nix b/mail-server/postfix.nix index cf6a783..5ef634f 100644 --- a/mail-server/postfix.nix +++ b/mail-server/postfix.nix @@ -28,6 +28,12 @@ let in "${from}@${cfg.domain} ${to}@${cfg.domain}") (builtins.attrNames cfg.virtualAliases); + # accountToIdentity :: User -> String + accountToIdentity = account: "${account.name}@${cfg.domain} ${account.name}@${cfg.domain}"; + + # vaccounts_identity :: [ String ] + vaccounts_identity = map accountToIdentity (lib.attrValues cfg.loginAccounts); + # valiases_file :: Path valiases_file = builtins.toFile "valias" (lib.concatStringsSep "\n" valiases_postfix); @@ -38,8 +44,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. - vaccounts_file = valiases_file; + # 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 ++ valiases_postfix)); in {