From 50ea97f8f3446eca8949a62501c5c66e14218dc5 Mon Sep 17 00:00:00 2001 From: Alexandre LUCAZEAU Date: Wed, 9 Feb 2022 15:17:37 +0100 Subject: [PATCH] FIX : mails config and add notmuch primary support --- DELL/nixpkgs/configs/.mbsyncrc | 2 +- DELL/nixpkgs/configs/msmtp_config | 2 +- DELL/nixpkgs/mails.nix | 66 +++++++++++++++++-------------- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/DELL/nixpkgs/configs/.mbsyncrc b/DELL/nixpkgs/configs/.mbsyncrc index 971ec34..432a0d1 100644 --- a/DELL/nixpkgs/configs/.mbsyncrc +++ b/DELL/nixpkgs/configs/.mbsyncrc @@ -1,7 +1,7 @@ IMAPAccount DRI Host imap.dri.fr User 1847_alexandre -PassCmd "pass email/alexandre" +PassCmd "keepassxc-cli show -a Password --no-password -k $HOME/keys/emails.key $HOME/Nextcloud/PRIVE/Keepass/emails.kbx emails" SSLType None IMAPStore DRI-remote diff --git a/DELL/nixpkgs/configs/msmtp_config b/DELL/nixpkgs/configs/msmtp_config index 7cbdb4b..93d8d47 100644 --- a/DELL/nixpkgs/configs/msmtp_config +++ b/DELL/nixpkgs/configs/msmtp_config @@ -14,5 +14,5 @@ port 587 domain dri.fr from alexandre@dri.fr user 1847_alexandre -passwordeval "pass email/alexandre" +passwordeval "keepassxc-cli show -a Password --no-password -k $HOME/keys/emails.key $HOME/Nextcloud/PRIVE/Keepass/emails.kbx emails" auth plain diff --git a/DELL/nixpkgs/mails.nix b/DELL/nixpkgs/mails.nix index 3713360..e9a98c2 100644 --- a/DELL/nixpkgs/mails.nix +++ b/DELL/nixpkgs/mails.nix @@ -1,34 +1,42 @@ { pkgs, config, lib, ... }:{ # accounts.email.maildirBasePath = "Mailsdir"; - # accounts.email.accounts = { - # "alexandre" = rec { - # primary = true; - # address = "alexandre@dri.fr"; - # userName = "1847_alexandre"; - # flavor = "plain"; - # folders = { - # inbox = "INBOX"; - # trash = "Junk"; - # }; - # imap = { - # host = "imap.dri.fr"; - # tls.enable = false; - # }; - # smtp = { - # host = "smtp.dri.fr"; - # port = 587; - # tls.enable = false; - # }; - # passwordCommand = "pass email/alexandre"; - # mbsync.enable = true; - # mbsync.create = true; - # msmtp.enable = true; - # msmtp.extraConfig = '' - # auth plain - # ''; - # }; - # }; - programs.msmtp.enable = true; + accounts.email= { + accounts = { + dri = { + primary = true; + address = "alexandre@dri.fr"; + userName = "1847_alexandre"; + realName = "Alexandre LUCAZEAU"; + passwordCommand = "keepassxc-cli show -a Password --no-password -k $HOME/keys/emails.key $HOME/Nextcloud/PRIVE/Keepass/emails.kbx emails"; + flavor = "plain"; + folders = { + inbox = "INBOX"; + trash = "Junk"; + }; + imap = { + host = "imap.dri.fr"; + tls.enable = false; + }; + smtp = { + host = "smtp.dri.fr"; + port = 587; + tls.enable = false; + }; + + mbsync.enable = true; + notmuch.enable = true; + }; + }; + }; + services.mbsync = { + enable = true; + }; + + programs = { + msmtp.enable = true; + mbsync.enable = true; + notmuch.enable = true; + }; xdg.configFile = { "msmtp/config".source= ./configs/msmtp_config; };