From da0d3180220740b29b3f8451228ee02d8ffab14c Mon Sep 17 00:00:00 2001 From: The_miro Date: Tue, 26 May 2026 16:07:54 +0200 Subject: [PATCH] feat(mail): install w3m and write mailcap for HTML email rendering Adds w3m to the install list and appends the text/html mailcap entry so alot renders HTML emails as plain text via w3m -dump. Co-Authored-By: Claude Sonnet 4.6 --- setup/modules/optional-Modules/apps/mail-notmuch.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup/modules/optional-Modules/apps/mail-notmuch.sh b/setup/modules/optional-Modules/apps/mail-notmuch.sh index 2827c58..1461987 100755 --- a/setup/modules/optional-Modules/apps/mail-notmuch.sh +++ b/setup/modules/optional-Modules/apps/mail-notmuch.sh @@ -2,8 +2,8 @@ set -euo pipefail source "$(dirname "${BASH_SOURCE[0]}")/../../lib/logging.sh" -log "Installing mail stack (isync, msmtp, notmuch, alot)..." -sudo pacman -S --noconfirm --needed isync msmtp notmuch alot +log "Installing mail stack (isync, msmtp, notmuch, alot, w3m)..." +sudo pacman -S --noconfirm --needed isync msmtp notmuch alot w3m # ── Credentials ─────────────────────────────────────────────────────────────── read -rp "Full name : " FULL_NAME @@ -110,6 +110,11 @@ with open(path, 'w') as f: f.write(text) PYEOF +# ── mailcap (HTML email rendering via w3m) ──────────────────────────────────── +log "Writing ~/.mailcap..." +grep -qxF "text/html; w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput" ~/.mailcap 2>/dev/null \ + || echo "text/html; w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput" >> ~/.mailcap + # ── systemd timer for periodic sync ─────────────────────────────────────────── log "Installing mbsync systemd user timer (every 5 min)..." mkdir -p ~/.config/systemd/user