2025-06-10 05:27:52 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
name = "postfix-tlspol";
|
|
|
|
|
|
|
|
meta.maintainers = with lib.maintainers; [ hexa ];
|
|
|
|
|
|
|
|
nodes.machine = {
|
2025-06-21 00:35:23 +02:00
|
|
|
services.postfix.enable = true;
|
2025-06-10 05:27:52 +02:00
|
|
|
services.postfix-tlspol.enable = true;
|
|
|
|
|
2025-06-29 00:01:13 +02:00
|
|
|
services.dnsmasq = {
|
|
|
|
enable = true;
|
|
|
|
settings.selfmx = true;
|
|
|
|
};
|
|
|
|
};
|
2025-06-10 05:27:52 +02:00
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
import json
|
|
|
|
|
|
|
|
machine.wait_for_unit("postfix-tlspol.service")
|
2025-06-28 23:39:34 +02:00
|
|
|
machine.succeed("getent group postfix-tlspol | grep :postfix")
|
2025-06-10 05:27:52 +02:00
|
|
|
|
|
|
|
with subtest("Interact with the service"):
|
|
|
|
machine.succeed("postfix-tlspol -purge")
|
|
|
|
|
|
|
|
response = json.loads((machine.succeed("postfix-tlspol -query localhost")))
|
|
|
|
machine.log(json.dumps(response, indent=2))
|
|
|
|
|
2025-06-29 00:01:13 +02:00
|
|
|
assert response["dane"]["policy"] == "", f"Unexpected DANE policy for localhost: {response["dane"]["policy"]}"
|
|
|
|
assert response["mta-sts"]["policy"] == "", f"Unexpected MTA-STS policy for localhost: {response["mta-sts"]["policy"]}"
|
2025-06-28 23:39:34 +02:00
|
|
|
|
|
|
|
machine.log(machine.execute("systemd-analyze security postfix-tlspol.service | grep -v ✓")[1])
|
2025-06-10 05:27:52 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
}
|