From ce7ad83402ea7ff1e74cce343396c83876c2a6f3 Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Mon, 18 Dec 2017 12:27:15 +0100 Subject: [PATCH] add test for explicit catchAlls #49 --- tests/extern.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/extern.nix b/tests/extern.nix index 523f6ae..e4c11ba 100644 --- a/tests/extern.nix +++ b/tests/extern.nix @@ -32,6 +32,7 @@ import { "user1@example.com" = { hashedPassword = "$6$/z4n8AQl6K$kiOkBTWlZfBd7PvF5GsJ8PmPgdZsFGN1jPGZufxxr60PoR0oUsrvzm2oQiflyz5ir9fFJ.d/zKm/NgLXNUsNX/"; aliases = [ "postmaster@example.com" ]; + catchAll = [ "example.com" ]; }; "user2@example.com" = { hashedPassword = "$6$u61JrAtuI0a$nGEEfTP5.eefxoScUGVG/Tl0alqla2aGax4oTd85v3j3xSmhv/02gNfSemv/aaMinlv9j/ZABosVKBrRvN5Qv0"; @@ -185,6 +186,19 @@ import { $client->succeed("fetchmail -v"); }; + + subtest "catchAlls", sub { + $client->succeed("rm ~/mail/*"); + $client->succeed("rm mail.txt"); + $client->succeed("echo '${email2}' > mail.txt"); + # send email from chuck to non exsitent account + $client->succeed("msmtp -a test3 --tls=on --tls-certcheck=off --auth=on lol\@example.com < mail.txt >&2"); + $client->succeed("sleep 5"); + # fetchmail returns EXIT_CODE 0 when it retrieves mail + $client->succeed("fetchmail -v"); + }; + + '';