Mailarchivierung & Browsing: mbsync, notmuch, alot
Inhaltsverzeichnis
Mailarchivierung & Browsing für Profis #
“Traue weder niemandem, noch Dir selbst…”
Setup mit mbsync, notmuch und alot #
Dieses HowTo beschreibt ein leichtgewichtiges, extrem schnelles und zuverlässiges Setup zur E-Mail-Archivierung auf Basis von:
- mbsync (Mail-Mirroring / Backup)
- notmuch (Volltextindex & Suche)
- alot (Notmuch-basierter Mailbrowser)
Das Zielsystem ist ideal für Entwickler, Sysadmins und alle, die lokale Kontrolle, hohe Geschwindigkeit und langfristige Archivierung suchen.
1. Motivation #
IMAP-Server sind keine Archive.
GUI-Clients wie Thunderbird sind für große Maildir-Bestände ungeeignet.
Dieses Setup bietet:
- schnelles, inkrementelles Backup per
mbsync - blitzschnelle Volltextsuche per
notmuch(Xapian-Index) - Terminal-basierte Mailnavigation per
alot - automatische Integration in Accounting- oder PDF-Extraktor-Pipelines
2. Verzeichnislayout #
Empfohlenes Layout:
~/mail/
konto1@example.com/
konto2@example.com/
Jeder Ordner ist ein natives Maildir, wie von mbsync erzeugt.
3. mbsync einrichten (Mail-Backup) #
Installation #
sudo apt install isync
Konfiguration (~/.mbsyncrc) #
IMAPStore konto1-remote
Host imap.example.com
User konto1@example.com
Pass "DEINPASSWORT"
SSLType IMAPS
MaildirStore konto1-local
SubFolders Verbatim
Path ~/mail/konto1@example.com/
Inbox ~/mail/konto1@example.com/INBOX/
Channel konto1
Far :konto1-remote:
Near :konto1-local:
Patterns *
Create Near
Expunge None
Sync Pull
Backup starten #
mbsync -a
Cronjob #
0 */6 * * * mbsync -a
4. Notmuch einrichten #
Installation #
sudo apt install notmuch
Setup #
notmuch setup
Bei „Where is your mail stored?“:
/home/<user>/mail
Erstindex #
cd ~/mail
notmuch new
5. Arbeiten mit Notmuch #
Suche #
notmuch search suchwort
notmuch search subject:rechnung
notmuch search path:konto1@example.com rechnung
Anzeige #
notmuch show id:MESSAGE_ID
Index aktualisieren #
notmuch new
6. alot installieren #
sudo apt install alot
Start:
alot
Features:
- Threaded view
- Tags
- Schnelle Navigation
- Volltextsuche
- Ideal für große Archive
7. Workflow #
mbsync -a
notmuch new
alot
8. Vorteile des Systems #
- 100 % lokal
- schnell
- durchsucht große Archive problemlos
- skriptfähig
- ideal für Automatisierung
9. Erweiterungen (optional) #
- Tag-Regeln
- PDF-Rechnungsparser
- PostgreSQL-Integration
- Web-Frontend (FastAPI)
10. Fazit #
Mit mbsync, notmuch und alot entsteht ein extrem performantes, nachhaltiges Mailarchiv, ideal für langfristige Datenspeicherung und automatisierte Weiterverarbeitung.