1 { pkgs, lib, config, ... }:
8 maildirBasePath = "mail/accounts";
11 address = "testbox@sourcephile.fr";
12 userName = "testbox@sourcephile.fr";
13 realName = "Test Box";
14 passwordCommand = "${pkgs.coreutils}/bin/cat /home/julm/mail/accounts/testbox.pass";
15 #passwordCommand = "${pkgs.pass}/bin/pass sourcephile/mail/julm";
16 #passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/rh.pass -d ${config.home.homeDirectory}/desktop/files/rh.pass.gpg";
17 imap.host = "mail.sourcephile.fr";
18 smtp.host = "mail.sourcephile.fr";
19 astroid.enable = true;
36 notmuch.enable = true;
39 home.file."bin/msmtp" = {
42 #!${pkgs.stdenv.shell}
43 ${pkgs.libnotify}/bin/notify-send "Sending mail ✉️"
44 ${pkgs.msmtp}/bin/msmtp --read-envelope-from $@
47 programs.msmtp.enable = true;
56 preExec = "${config.xdg.configHome}/mbsync/preExec";
57 postExec = "${config.xdg.configHome}/mbsync/postExec";
60 xdg.configFile."mbsync/preExec".source = pkgs.writeShellScript "mbsync-preExec" ''
61 export NOTMUCH_PROFILE=default
62 export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/$NOTMUCH_PROFILE/config
63 export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug
66 ${pkgs.coreutils}/bin/mkdir -p ${config.home.homeDirectory}/mail/accounts
67 ${pkgs.afew}/bin/afew --move-mails --verbose
69 xdg.configFile."mbsync/postExec".source = pkgs.writeShellScript "mbsync-postExec" ''
70 export NOTMUCH_PROFILE=default
71 export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/$NOTMUCH_PROFILE/config
72 export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug
75 ${pkgs.notmuch}/bin/notmuch new
76 ${pkgs.afew}/bin/afew --tag --new --verbose
77 # Remove inbox (lower-case)
78 #${pkgs.notmuch}/bin/notmuch tag -inbox -- tag:inbox
79 # Remove Inbox tagged message that are not in an Inbox
80 #${pkgs.notmuch}/bin/notmuch tag -Inbox -- not folder:perso/Inbox and tag:Inbox
81 ${pkgs.libnotify}/bin/notify-send "Mails synced 📬"
83 home.file."bin/msync".source = pkgs.writeShellScript "msync" ''
84 ${pkgs.libnotify}/bin/notify-send "Syncing mails 📫️"
85 systemctl --user start mbsync
87 programs.mbsync.enable = true;
88 programs.notmuch.enable = true;
96 [ArchiveSentMailsFilter]
106 Junk = 'NOT tag:spam':INBOX
111 externalEditor = "emacsclient -c";
113 startup.queries.new = "tag:new";
114 startup.queries.inbox = "tag:inbox";
115 startup.queries.testbox = "to:testbox";
116 startup.queries.mail = "folder:mail/accounts/testbox";