Send emails on a regular basis (don't stack forever)

This commit is contained in:
eeva 2017-03-11 16:47:37 +01:00
parent dd9000212b
commit 42cb7eac04
2 changed files with 18 additions and 5 deletions

View file

@ -39,7 +39,6 @@
pavucontrol
dell-530cdn
arandr
inotify-tools
];
};

View file

@ -8,13 +8,15 @@
# and various automation provided by systemd
{ config, pkgs, ... }:
let mu-light = (pkgs.mu.override { withMug = false; }); # no webkit dependency
in
{
environment.systemPackages = with pkgs; [
msmtp
neomutt
ripmime
mu-light
w3m
(mu.override { withMug = false; }) # no webkit dependency
];
services.offlineimap = {
@ -25,15 +27,27 @@
systemd.user.services = {
mu = {
description = "Updating mail database";
script = "/run/current-system/sw/bin/mu index --quiet -m ~/mail";
path = [ mu-light ];
script = "mu index --quiet -m ~/mail";
startAt = "daily";
wantedBy = [ "timers.target" ];
};
offlineimap-fast = {
description = "Quick mail synchronization";
script = "/run/current-system/sw/bin/offlineimap -u quiet -q";
path = [ pkgs.offlineimap ];
script = "offlineimap -u quiet -q";
};
msmtp-runqueue = {
description = "Flushing mail queue";
script = builtins.readFile "/home/eeva/prefix/bin/msmtp-runqueue";
preStart = "mkdir -p /home/eeva/.msmtpqueue";
startAt = "*:0/10";
serviceConfig = {
Restart = "on-failure";
};
path = [ pkgs.msmtp ];
};
};
}