Use mbsync instead of offlineimap

This commit is contained in:
Charlotte Van Petegem 2021-01-05 18:58:12 +01:00
parent 097fd25b86
commit e896b6a6c2
No known key found for this signature in database
GPG key ID: 019E764B7184435A

View file

@ -26,15 +26,24 @@ let
imapnotify = { imapnotify = {
enable = true; enable = true;
boxes = [ "INBOX" ]; boxes = [ "INBOX" ];
onNotify = "${pkgs.offlineimap}/bin/offlineimap -a ${name} -f INBOX"; onNotify = "${pkgs.isync}/bin/mbsync ${name}:INBOX";
onNotifyPost = "${notifyScript name}"; onNotifyPost = "${notifyScript name}";
}; };
mbsync = {
enable = true;
create = "both";
expunge = "both";
flatten = ".";
remove = "both";
extraConfig.account = {
AuthMechs = "PLAIN";
};
};
msmtp.enable = true; msmtp.enable = true;
neomutt = { neomutt = {
enable = true; enable = true;
sendMailCommand = "msmtpq --read-envelope-from --read-recipients --account ${name}"; sendMailCommand = "msmtpq --read-envelope-from --read-recipients --account ${name}";
}; };
offlineimap.enable = true;
passwordCommand = "${passwordScript} ${passFile}"; passwordCommand = "${passwordScript} ${passFile}";
realName = "Charlotte Van Petegem"; realName = "Charlotte Van Petegem";
signature = { signature = {
@ -108,18 +117,18 @@ in
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "Sent Items"; trash = "Deleted Items"; }; folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "Sent Items"; trash = "Deleted Items"; };
}; };
}; };
work-aap-we-fr = makeAccount { #work-aap-we-fr = makeAccount {
name = "work-aap-we-fr"; # name = "work-aap-we-fr";
address = "aap-we-fr@ugent.be"; # address = "aap-we-fr@ugent.be";
imapHost = "owa.ugent.be"; # imapHost = "owa.ugent.be";
smtpHost = "smtp.ugent.be"; # smtpHost = "smtp.ugent.be";
passFile = "work/UGentNet"; # passFile = "work/UGentNet";
useStartTls = true; # useStartTls = true;
extraConfig = { # extraConfig = {
userName = "UGENT\\ecvpeteg/aap-we-fr"; # userName = "UGENT\\ecvpeteg/aap-we-fr";
folders = { drafts = "Concepten"; inbox = "INBOX"; sent = "Verzonden items"; trash = "Verwijderde items"; }; # folders = { drafts = "Concepten"; inbox = "INBOX"; sent = "Verzonden items"; trash = "Verwijderde items"; };
}; # };
}; #};
posteo = makeAccount { posteo = makeAccount {
name = "posteo"; name = "posteo";
address = "chvp@posteo.net"; address = "chvp@posteo.net";
@ -267,6 +276,7 @@ in
}; };
}; };
programs = { programs = {
mbsync.enable = true;
msmtp.enable = true; msmtp.enable = true;
neomutt = { neomutt = {
enable = true; enable = true;
@ -278,20 +288,19 @@ in
''; '';
vimKeys = true; vimKeys = true;
}; };
offlineimap.enable = true;
}; };
services = { services = {
imapnotify.enable = true; imapnotify.enable = true;
}; };
systemd.user = { systemd.user = {
services = { services = {
offlineimap = { mbsync = {
Unit = { Unit = {
Description = "OfflineIMAP email fetcher"; Description = "MBSync email fetcher";
After = "network-online.target"; After = "network-online.target";
Wants = "network-online.target"; Wants = "network-online.target";
}; };
Service = { ExecStart = "${pkgs.offlineimap}/bin/offlineimap"; }; Service = { ExecStart = "${pkgs.isync}/bin/mbsync -a"; };
}; };
vdirsyncer = { vdirsyncer = {
Unit = { Unit = {
@ -303,11 +312,11 @@ in
}; };
}; };
timers = { timers = {
offlineimap = { mbsync = {
Unit = { Description = "OfflineIMAP email fetcher"; }; Unit = { Description = "MBSync email fetcher"; };
Timer = { Timer = {
OnCalendar = "*:0/5"; OnCalendar = "*:0/5";
Unit = "offlineimap.service"; Unit = "mbsync.service";
}; };
Install = { WantedBy = [ "timers.target" ]; }; Install = { WantedBy = [ "timers.target" ]; };
}; };