From a7396c5b25767f4e0c66c49ddb77fc186c4d219a Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Tue, 21 Nov 2017 11:36:04 +0100 Subject: [PATCH] add test for valiases --- tests/extern.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/extern.nix b/tests/extern.nix index 0b928d7..63711aa 100644 --- a/tests/extern.nix +++ b/tests/extern.nix @@ -31,9 +31,11 @@ import { loginAccounts = { "user1@example.com" = { hashedPassword = "$6$/z4n8AQl6K$kiOkBTWlZfBd7PvF5GsJ8PmPgdZsFGN1jPGZufxxr60PoR0oUsrvzm2oQiflyz5ir9fFJ.d/zKm/NgLXNUsNX/"; + aliases = [ "postmaster@example.com" ]; }; "user2@example.com" = { hashedPassword = "$6$u61JrAtuI0a$nGEEfTP5.eefxoScUGVG/Tl0alqla2aGax4oTd85v3j3xSmhv/02gNfSemv/aaMinlv9j/ZABosVKBrRvN5Qv0"; + aliases = [ "chuck@example.com" ]; }; "user@example2.com" = { hashedPassword = "$6$u61JrAtuI0a$nGEEfTP5.eefxoScUGVG/Tl0alqla2aGax4oTd85v3j3xSmhv/02gNfSemv/aaMinlv9j/ZABosVKBrRvN5Qv0"; @@ -78,6 +80,13 @@ import { from user\@example2.com user user\@example2.com password user2 + + account test3 + host SERVER + port 587 + from chuck\@example.com + user user2\@example.com + password user2 ''; email1 = '' @@ -160,5 +169,19 @@ import { # make sure it is dkim signed $client->succeed("grep DKIM ~/mail/*"); }; + + subtest "aliases", sub { + $client->succeed("rm ~/mail/*"); + $client->succeed("rm mail.txt"); + $client->succeed("echo '${email2}' > mail.txt"); + # send email from chuck to postmaster + $client->succeed("msmtp -a test3 --tls=on --tls-certcheck=off --auth=on postmaster\@example.com < mail.txt >&2"); + $client->succeed("sleep 5"); + # fetchmail returns EXIT_CODE 0 when it retrieves mail + $client->succeed("fetchmail -v"); + }; + ''; + + }