From 52ffc5ef7b002ed389255ec02d260c9d9d931c16 Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Mon, 18 Dec 2017 22:02:58 +0100 Subject: [PATCH 1/5] update readme catchAll --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index da8182e..5d5ada3 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,13 @@ common ones. "postmaster@example.com" "postmaster@example2.com" ]; + + # Make this user the catchAll address for domains example.com and + # example2.com + catchAll = [ + "example.com" + "example2.com" + ]; }; "user2@example.com" = { ... }; From f64f870a9f0549edf895ff5c30429c25b70ac2cb Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Mon, 18 Dec 2017 22:06:30 +0100 Subject: [PATCH 2/5] update readme for v2.0.3 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d5ada3..b980f71 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Stable Releases -* [SNM v2.0.2](https://github.com/r-raymond/nixos-mailserver/releases/v2.0.2) +* [SNM v2.0.3](https://github.com/r-raymond/nixos-mailserver/releases/v2.0.3) [Latest Release (Candidate)](https://github.com/r-raymond/nixos-mailserver/releases/latest) @@ -123,7 +123,7 @@ common ones. { config, pkgs, ... }: { imports = [ - (builtins.fetchTarball "https://github.com/r-raymond/nixos-mailserver/archive/v2.0.2.tar.gz") + (builtins.fetchTarball "https://github.com/r-raymond/nixos-mailserver/archive/v2.0.3.tar.gz") ]; mailserver = { From 51058db71e47ccd98af2044698ec44682b52ba23 Mon Sep 17 00:00:00 2001 From: Ruben Maher Date: Wed, 20 Dec 2017 09:34:09 +1030 Subject: [PATCH 3/5] tests/extern: assert catchall doesn't steal from existing accounts --- tests/extern.nix | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/extern.nix b/tests/extern.nix index e4c11ba..28fff3b 100644 --- a/tests/extern.nix +++ b/tests/extern.nix @@ -48,7 +48,9 @@ import { }; client = { config, pkgs, ... }: { - environment.systemPackages = with pkgs; [ fetchmail msmtp procmail ]; + environment.systemPackages = with pkgs; [ + fetchmail msmtp procmail findutils + ]; }; }; @@ -88,6 +90,13 @@ import { from chuck\@example.com user user2\@example.com password user2 + + account test4 + host SERVER + port 587 + from postmaster\@example.com + user user1\@example.com + password user1 ''; email1 = '' @@ -117,6 +126,20 @@ import { XOXO User1 ''; + email3 = + '' + From: Postmaster + To: Chuck + Cc: + Bcc: + Subject: This is a test Email from postmaster\@example.com to chuck + Reply-To: + + Hello Chuck, + + I think I may have misconfigured the mail server + XOXO Postmaster + ''; in '' startAll; @@ -196,6 +219,16 @@ import { $client->succeed("sleep 5"); # fetchmail returns EXIT_CODE 0 when it retrieves mail $client->succeed("fetchmail -v"); + + $client->succeed("rm ~/mail/*"); + $client->succeed("rm mail.txt"); + $client->succeed("echo '${email2}' > mail.txt"); + # send email from user1 to chuck + $client->succeed("msmtp -a test4 --tls=on --tls-certcheck=off --auth=on chuck\@example.com < mail.txt >&2"); + $client->succeed("sleep 5"); + # fetchmail returns EXIT_CODE 1 when no new mail + # if this succeeds, it means that user1 recieved the mail that was intended for chuck. + $client->fail("fetchmail -v"); }; From 3a333ab71a110423dce818ea93670d6b3115a7da Mon Sep 17 00:00:00 2001 From: Ruben Maher Date: Wed, 20 Dec 2017 10:54:57 +1030 Subject: [PATCH 4/5] mail-server/postfix: add each loginAccount to virtual_alias_maps --- mail-server/postfix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail-server/postfix.nix b/mail-server/postfix.nix index bc8ae6c..b36accd 100644 --- a/mail-server/postfix.nix +++ b/mail-server/postfix.nix @@ -26,7 +26,7 @@ let valiases_postfix = lib.flatten (lib.mapAttrsToList (name: value: let to = name; - in map (from: "${from} ${to}") value.aliases) + in map (from: "${from} ${to}") (value.aliases ++ lib.singleton name)) cfg.loginAccounts); # catchAllPostfix :: [ String ] From 67cdb360541a2dee149cd9c0597e6a1f0a28ea78 Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Wed, 20 Dec 2017 08:40:58 +0100 Subject: [PATCH 5/5] update readme v2.0.4 --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b980f71..52dcc21 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Stable Releases -* [SNM v2.0.3](https://github.com/r-raymond/nixos-mailserver/releases/v2.0.3) +* [SNM v2.0.4](https://github.com/r-raymond/nixos-mailserver/releases/v2.0.4) [Latest Release (Candidate)](https://github.com/r-raymond/nixos-mailserver/releases/latest) @@ -46,11 +46,12 @@ D9FE 4119 F082 6F15 93BD BD36 6162 DBA5 635E A16A * Sieves - [x] A simple standard script that moves spam - [x] Allow user defined sieve scripts + * User Aliases + - [x] Regular aliases + - [x] Catch all aliases ### In the future - * User Aliases - - [ ] More complete alias support (Differentiate between forwarding addresses and sending aliases) * DKIM Signing - [ ] Allow a per domain selector @@ -123,7 +124,7 @@ common ones. { config, pkgs, ... }: { imports = [ - (builtins.fetchTarball "https://github.com/r-raymond/nixos-mailserver/archive/v2.0.3.tar.gz") + (builtins.fetchTarball "https://github.com/r-raymond/nixos-mailserver/archive/v2.0.4.tar.gz") ]; mailserver = {