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:
|
# Mail stack:
|
||||||
# Display maildirs and read emails -> neomutt
|
# Display maildirs and read emails -> neomutt
|
||||||
# Write emails -> vim (should already be there)
|
# Write emails -> vim (should already be there)
|
||||||
# Receive emails & synchronize maildir -> offlineimap
|
# Receive emails & synchronize maildir -> mbsync (isync)
|
||||||
# Submit emails to send -> msmtp
|
# Submit emails to send -> msmtp
|
||||||
# Deal with MIME encoded email packages -> ripmime
|
# Deal with MIME encoded email packages -> ripmime
|
||||||
# Display HTML emails -> w3m
|
# Display HTML emails -> w3m
|
||||||
# Search maildirs -> mu
|
# Search maildirs -> mu
|
||||||
|
# Send encrypted email -> gpupg1orig
|
||||||
# and various automation provided by systemd
|
# and various automation provided by systemd
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
@ -18,14 +19,27 @@ in
|
||||||
ripmime
|
ripmime
|
||||||
mu-light
|
mu-light
|
||||||
w3m
|
w3m
|
||||||
|
isync
|
||||||
|
gnupg1orig
|
||||||
];
|
];
|
||||||
|
|
||||||
services.offlineimap = {
|
|
||||||
enable = true;
|
|
||||||
onCalendar = "*:0/5";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services = {
|
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 = {
|
mu = {
|
||||||
description = "Updating mail database";
|
description = "Updating mail database";
|
||||||
path = [ mu-light ];
|
path = [ mu-light ];
|
||||||
|
@ -34,19 +48,14 @@ in
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
offlineimap-fast = {
|
|
||||||
description = "Quick mail synchronization";
|
|
||||||
path = [ pkgs.offlineimap ];
|
|
||||||
script = "offlineimap -u quiet -q";
|
|
||||||
};
|
|
||||||
|
|
||||||
msmtp-runqueue = {
|
msmtp-runqueue = {
|
||||||
description = "Flushing mail queue";
|
description = "Flushing mail queue";
|
||||||
script = builtins.readFile "/home/eeva/prefix/bin/msmtp-runqueue";
|
script = builtins.readFile "/home/eeva/prefix/bin/msmtp-runqueue";
|
||||||
preStart = "mkdir -p /home/eeva/.msmtpqueue";
|
preStart = "mkdir -p /home/eeva/.msmtpqueue";
|
||||||
|
postStop = "rm -f /home/eeva/.msmtpqueue/.lock";
|
||||||
startAt = "*:0/10";
|
startAt = "*:0/10";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "on-failure";
|
TimeoutStartSec = "2min";
|
||||||
};
|
};
|
||||||
path = [ pkgs.msmtp ];
|
path = [ pkgs.msmtp ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue