seabbs / seabbs/dotfiles

feat: add terminal email with aerc + notmuch + mbsync + M365 OAuth2

Open
#30 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
0
Forks
0
Avg merge
2h 10m
Merged PRs (30d)
8

Description

Summary

Set up terminal email using aerc as the frontend, with full offline support and M365 OAuth2 authentication.

Proposed stack

sbfnk/M365-Auth  (OAuth2 tokens → macOS Keychain)
       │
       ├──→ mbsync (IMAP sync → local Maildir)
       │         ↓
       │    notmuch (search/tag index)
       │         ↓
       │    aerc (notmuch backend — read, search, tag)
       │
       └──→ msmtp + msmtpq (SMTP sending + offline queue)

Components

Component Install Purpose
aerc brew install aerc TUI email client (notmuch backend)
isync (mbsync) brew install --HEAD sbfnk/formulae/isync IMAP sync to local Maildir with XOAUTH2
notmuch brew install notmuch Search index + tag engine over Maildir
msmtp brew install msmtp SMTP sending (ships with msmtpq)
M365-Auth pipx install git+https://github.com/sbfnk/M365-Auth OAuth2 token management
w3m brew install w3m HTML email rendering filter for aerc

Config files to create

~/.config/
├── aerc/
│   ├── accounts.conf    # Account source/outgoing/credentials
│   ├── aerc.conf        # UI, filters, hooks, compose settings
│   ├── binds.conf       # Keybindings (vim-style)
│   └── stylesets/       # Theme (catppuccin)
├── m365auth/
│   └── config.py        # Client ID, scopes, authority URL
├── notmuch/
│   └── default/config   # Database path, user info, new mail tags
├── msmtp/
│   └── config           # SMTP account with xoauth2 auth
└── mbsync/
    └── mbsyncrc         # IMAP channels, Maildir paths, PassCmd
~/Mail/                  # Local Maildir root
~/Library/LaunchAgents/
├── mail.sync.plist      # Periodic mbsync + notmuch new
└── mail.sendqueue.plist # Periodic msmtpq flush

Why this architecture

  • aerc as frontend — vim keybindings, runs in tmux pane/popup, uses neovim for composing
  • notmuch backend (not raw IMAP) — full offline access, fast local full-text search, tag-based workflows
  • mbsync for sync — battle-tested IMAP-to-Maildir. Seb's custom isync formula adds XOAUTH2 SASL support
  • Seb's M365-Auth for OAuth2 — Python + macOS Keychain + Thunderbird client ID. No Haskell (oama) or GPG (mutt_oauth2.py) needed. refresh-token --profile mail slots into mbsync PassCmd and msmtp passwordeval
  • msmtpq for offline sending — queues outgoing mail when offline, flushes via LaunchAgent
  • Backend is identical to sbfnk/dotfiles (mu4e swapped for aerc) — Seb can help debug

tmux integration

Add a popup keybinding similar to gh-dash:

bind-key M display-popup -E -w 90% -h 80% -d '#{pane_current_path}' 'aerc'

Open questions

  • Confirm IMAP is enabled on M365 tenant (if not, need DavMail gateway)
  • Single account (work) or multiple accounts?
  • Decide on catppuccin or tokyonight styleset for aerc

References

This was opened by a bot. Please ping @seabbs for any questions.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by resolving the open questions about M365 IMAP access, account count, and the aerc styleset. Then review the listed configuration paths under ~/.config/ and ~/Library/LaunchAgents/, along with the aerc, mbsync, notmuch, msmtp, and M365-Auth references. Done means the terminal mail stack is installed, configured for offline sync and sending, and integrated with the proposed tmux popup.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, neovim, python, shell
Domain
authentication, cli, desktop, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.