mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-12-28 03:50:34 +05:00
add test for explicit catchAlls #49
This commit is contained in:
parent
fc9b63f0e6
commit
ce7ad83402
@ -32,6 +32,7 @@ import <nixpkgs/nixos/tests/make-test.nix> {
|
||||
"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 <nixpkgs/nixos/tests/make-test.nix> {
|
||||
$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");
|
||||
};
|
||||
|
||||
|
||||
'';
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user