From a2943e74e3bb7c8c793bf6e03a81b446038f6b53 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 6 Aug 2021 10:32:40 +0200 Subject: [PATCH] nixos/nullmailer: Create "failed" directory Nullmailer expects that this directory exists (see https://github.com/bruceg/nullmailer/blob/073f4e9c5d015ed50074afe603e7faa32e34599e/doc/nullmailer-send.8#L185). When it doesn't and an email cannot be sent due to a permanent failure or has been in the queue longer than queuelifetime (7 days), message "Can't rename file: No such file or directory" starts appearing in the log and nullmailer never sends "Could not send message" notification. This means that the user may never learn that his email was not delivered. --- nixos/modules/services/mail/nullmailer.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/mail/nullmailer.nix b/nixos/modules/services/mail/nullmailer.nix index 09874ca0ed75..f9c345669978 100644 --- a/nixos/modules/services/mail/nullmailer.nix +++ b/nixos/modules/services/mail/nullmailer.nix @@ -220,7 +220,7 @@ with lib; after = [ "network.target" ]; preStart = '' - mkdir -p /var/spool/nullmailer/{queue,tmp} + mkdir -p /var/spool/nullmailer/{queue,tmp,failed} rm -f /var/spool/nullmailer/trigger && mkfifo -m 660 /var/spool/nullmailer/trigger '';