add vitual mail users
This commit is contained in:
commit
436cf0513b
7 changed files with 61 additions and 22 deletions
|
@ -25,6 +25,7 @@ import <nixpkgs/nixos/tests/make-test.nix> {
|
|||
|
||||
mailserver = {
|
||||
enable = true;
|
||||
debug = true;
|
||||
fqdn = "mail.example.com";
|
||||
domains = [ "example.com" "example2.com" ];
|
||||
dhParamBitLength = 512;
|
||||
|
@ -42,6 +43,10 @@ import <nixpkgs/nixos/tests/make-test.nix> {
|
|||
"user@example2.com" = {
|
||||
hashedPassword = "$6$u61JrAtuI0a$nGEEfTP5.eefxoScUGVG/Tl0alqla2aGax4oTd85v3j3xSmhv/02gNfSemv/aaMinlv9j/ZABosVKBrRvN5Qv0";
|
||||
};
|
||||
"lowquota@example.com" = {
|
||||
hashedPassword = "$6$u61JrAtuI0a$nGEEfTP5.eefxoScUGVG/Tl0alqla2aGax4oTd85v3j3xSmhv/02gNfSemv/aaMinlv9j/ZABosVKBrRvN5Qv0";
|
||||
quota = "1B";
|
||||
};
|
||||
};
|
||||
|
||||
enableImap = true;
|
||||
|
@ -224,5 +229,22 @@ import <nixpkgs/nixos/tests/make-test.nix> {
|
|||
# if this succeeds, it means that user1 recieved the mail that was intended for chuck.
|
||||
$client->fail("fetchmail -v");
|
||||
};
|
||||
|
||||
subtest "quota", sub {
|
||||
$client->execute("rm ~/mail/*");
|
||||
|
||||
$client->succeed("echo '${fetchmailRcLowQuota}' > ~/.fetchmailrc");
|
||||
$client->succeed("sed -i s/SERVER/`getent hosts server | awk '{ print \$1 }'`/g ~/.fetchmailrc");
|
||||
|
||||
$client->succeed("chmod 0700 ~/.fetchmailrc");
|
||||
$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 lowquota\@example.com < mail.txt >&2");
|
||||
$client->succeed("sleep 5");
|
||||
# fetchmail returns EXIT_CODE 0 when it retrieves mail
|
||||
$client->fail("fetchmail -v");
|
||||
|
||||
};
|
||||
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -45,14 +45,6 @@ import <nixpkgs/nixos/tests/make-test.nix> {
|
|||
$machine->start;
|
||||
$machine->waitForUnit("multi-user.target");
|
||||
|
||||
subtest "user exists", sub {
|
||||
$machine->succeed("cat /etc/shadow | grep 'user1\@example.com'");
|
||||
};
|
||||
|
||||
subtest "password is set", sub {
|
||||
$machine->succeed("cat /etc/shadow | grep 'user1\@example.com:\$6\$/z4n8AQl6K\$kiOkBTWlZfBd7PvF5GsJ8PmPgdZsFGN1jPGZufxxr60PoR0oUsrvzm2oQiflyz5ir9fFJ.d/zKm/NgLXNUsNX/:1::::::'");
|
||||
};
|
||||
|
||||
subtest "vmail gid is set correctly", sub {
|
||||
$machine->succeed("getent group vmail | grep 5000");
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue