add service to flush the msmtp queue

This commit is contained in:
Grigory Shipunov 2023-02-13 14:31:11 +01:00
parent 9d1c35311c
commit 8b13219861
Signed by: 0xa
GPG key ID: 91FA5E5BF9AA901C

View file

@ -8,7 +8,6 @@ in
msmtp msmtp
neomutt neomutt
notmuch notmuch
pass
w3m w3m
links2 links2
]; ];
@ -81,6 +80,7 @@ in
systemd.user = { systemd.user = {
# Service and timer to sync imap to local maildir
services.mbsync = { services.mbsync = {
enable = true; enable = true;
after = [ "graphical.target" "network-online.target" ]; after = [ "graphical.target" "network-online.target" ];
@ -102,5 +102,27 @@ in
}; };
}; };
# service and timer to flush the msmtp queue
services.flush-msmtpq = {
enable = true;
after = [ "graphical.target" "network-online.target" ];
script = ''
${pkgs.msmtp}/bin/msmtp-queue -r
'';
serviceConfig = {
Type = "oneshot";
};
};
timers.flush-msmtpq = {
enable = true;
wantedBy = [ "timers.target" ];
timerConfig = {
Unit = "flush-msmtpq.service";
OnBootSec = "11m";
OnUnitInactiveSec = "13m";
};
};
}; };
} }