offlineimap -> mbsync
This commit is contained in:
parent
777d363f2f
commit
eaaf3290ad
1 changed files with 22 additions and 13 deletions
35
mail.nix
35
mail.nix
|
@ -1,11 +1,12 @@
|
|||
# Mail stack:
|
||||
# Display maildirs and read emails -> neomutt
|
||||
# Write emails -> vim (should already be there)
|
||||
# Receive emails & synchronize maildir -> offlineimap
|
||||
# Receive emails & synchronize maildir -> mbsync (isync)
|
||||
# Submit emails to send -> msmtp
|
||||
# Deal with MIME encoded email packages -> ripmime
|
||||
# Display HTML emails -> w3m
|
||||
# Search maildirs -> mu
|
||||
# Send encrypted email -> gpupg1orig
|
||||
# and various automation provided by systemd
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
|
@ -18,14 +19,27 @@ in
|
|||
ripmime
|
||||
mu-light
|
||||
w3m
|
||||
isync
|
||||
gnupg1orig
|
||||
];
|
||||
|
||||
services.offlineimap = {
|
||||
enable = true;
|
||||
onCalendar = "*:0/5";
|
||||
};
|
||||
|
||||
systemd.user.services = {
|
||||
mbsync = {
|
||||
description = "IMAP mailbox sync";
|
||||
path = [ pkgs.isync ];
|
||||
script = "mbsync -c /home/eeva/.mutt/mbsyncrc -q -a";
|
||||
startAt = "*:0/3";
|
||||
wantedBy = [ "timers.target" ];
|
||||
serviceConfig = {
|
||||
TimeoutStartSec = "2min";
|
||||
};
|
||||
preStart = ''
|
||||
mkdir -p /home/eeva/mail/EEVA
|
||||
mkdir -p /home/eeva/mail/MPO
|
||||
mkdir -p /home/eeva/mail/LACL
|
||||
'';
|
||||
};
|
||||
|
||||
mu = {
|
||||
description = "Updating mail database";
|
||||
path = [ mu-light ];
|
||||
|
@ -34,19 +48,14 @@ in
|
|||
wantedBy = [ "timers.target" ];
|
||||
};
|
||||
|
||||
offlineimap-fast = {
|
||||
description = "Quick mail synchronization";
|
||||
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";
|
||||
postStop = "rm -f /home/eeva/.msmtpqueue/.lock";
|
||||
startAt = "*:0/10";
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
TimeoutStartSec = "2min";
|
||||
};
|
||||
path = [ pkgs.msmtp ];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue