Template private desktop mail configs

Render personal desktop configs from Ansible templates so public dotfiles no longer expose real identities or mail addresses. Update the bootstrap workflow to consume the rendered mail config and extend the encrypted vault schema for the new private values.
This commit is contained in:
Fabio Scotto di Santolo
2026-03-18 15:00:56 +01:00
parent b88e4feae7
commit c9ad30c113
9 changed files with 280 additions and 20 deletions

View File

@@ -0,0 +1,83 @@
[init]
defaultBranch = main
[core]
excludesfile = ~/.gitignore_global
pager = delta
[user]
name = {{ vault_personal_full_name }}
email = {{ vault_git_email }}
signingkey = {{ vault_git_signing_key }}
[fetch]
prune = true
[remote "origin"]
prune = true
[pull]
rebase = true
[commit]
gpgsign = false
[merge]
conflictstyle = diff3
tool = meld
[mergetool]
prompt = false
[diff]
tool = meld
[color]
ui = always
[color "status"]
branch = magenta
untracked = cyan
unmerged = yellow bold
[color "diff"]
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 52
[help]
autocorrect = 30
[interactive]
diffFilter = delta --color-only
[alias]
co = checkout
br = branch
ci = commit
st = status
ld = log -p
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)%n' --all
glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
onelinegraph = log --oneline --graph --decorate
undo = reset --soft HEAD~1
stash-all = stash save --include-untracked
expireunreachablenow = reflog expire --expire-unreachable=now --all
gcunreachablenow = gc --prune=now
[include]
path = ~/.themes.gitignore
[delta]
features = catppuccin-mocha navigate
true-color = always
colorMoved = default
tabs = 4
side-by-side = true

View File

@@ -0,0 +1,47 @@
##################### iCloud Account ##################################
IMAPStore iCloud-remote
Host imap.mail.me.com
Port 993
User {{ vault_icloud_email }}
PassCmd "secret-tool lookup icloud-mail icloud"
AuthMechs *
SSLType IMAPS
SSLVersions TLSv1.2 TLSv1.3
PipelineDepth 1
MaildirStore iCloud-local
Path ~/Maildir/iCloudAccount/
Inbox ~/Maildir/iCloudAccount/INBOX
SubFolders Verbatim
Channel iCloud
Far :iCloud-remote:
Near :iCloud-local:
Patterns *
Create Both
Expunge Both
SyncState *
##################### Protonmail Account ##################################
IMAPStore protonmail-remote
Host 127.0.0.1
Port 1143
User {{ vault_protonmail_email }}
PassCmd "secret-tool lookup protonmail-bridge protonmail"
AuthMechs *
SSLType STARTTLS
PipelineDepth 1
CertificateFile ~/.config/protonmail/bridge-v3/cert.pem
MaildirStore protonmail-local
Path ~/Maildir/ProtonMailAccount/
Inbox ~/Maildir/ProtonMailAccount/INBOX
SubFolders Verbatim
Channel Protonmail
Far :protonmail-remote:
Near :protonmail-local:
Patterns *
Create Both
Expunge Both
SyncState *

View File

@@ -0,0 +1,51 @@
# Set default values for all following accounts.
defaults
# Always use TLS
tls on
# Set a list of trusted CAs for TLS. The default is to use system settings,
# but you can select your own file.
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.cache/msmtp.log
# Account iCloud
account icloud
# Host name of the SMTP server
host smtp.mail.me.com
# Use the mail submission port 587 instead of the SMTP port 25
port 587
# Envelop-from address
from {{ vault_icloud_email }}
# Authentication. The password is given using one of five methods
auth on
user {{ vault_icloud_email }}
passwordeval "secret-tool lookup icloud-mail icloud"
# Account Protonmail
account protonmail
# Hostname of the Protonmail bridge
host 127.0.0.1
# Port of the Protonmail bridge
port 1025
# Envelop-from address
from {{ vault_protonmail_email }}
# Security
tls on
tls_trust_file ~/.config/protonmail/bridge-v3/cert.pem
# Authentication
auth on
user {{ vault_protonmail_email }}
passwordeval "secret-tool lookup protonmail-bridge protonmail"
# Set a default account
account default : icloud

View File

@@ -0,0 +1,51 @@
;;; email.el -*-
(use-package mu4e
:ensure nil
:load-path "/usr/share/emacs/site-lisp/mu4e/"
:defer 20 ; Wait until 20 seconds after startup
:config
;; This is set to 't' to avoid mail syncing issues when using mbsync
(setq mu4e-change-filenames-when-moving t)
;; Refresh mail using isync every 10 minutes
(setq mu4e-update-interval (* 10 60))
(setq mu4e-get-mail-command "~/.emacs.d/scripts/email_sync.sh")
(setq mu4e-maildir "~/Maildir")
;; Configure email accounts
(setq mu4e-contexts
(list
;; Protonmail Account
(make-mu4e-context
:name "Protonmail"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/ProtonMailAccount" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "{{ vault_protonmail_email }}")
(user-full-name . "{{ vault_personal_full_name }}")
(mu4e-drafts-folder . "/ProtonMailAccount/Drafts")
(mu4e-sent-folder . "/ProtonMailAccount/Sent")
(mu4e-refile-folder . "/ProtonMailAccount/All Mail")
(mu4e-trash-folder . "/ProtonMailAccount/Trash")))
;; iCloud Account
(make-mu4e-context
:name "iCloud Mail"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/iCloudAccount" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "{{ vault_icloud_email }}")
(user-full-name . "{{ vault_personal_full_name }}")
(mu4e-drafts-folder . "/iCloudAccount/Drafts")
(mu4e-sent-folder . "/iCloudAccount/Sent Messages")
(mu4e-refile-folder . "/iCloudAccount/INBOX")
(mu4e-trash-folder . "/iCloudAccount/Junk")))))
(setq sendmail-program "/usr/bin/msmtp"
send-mail-function 'sendmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function 'message-send-mail-with-sendmail))