Adds the ability to import Microsoft Outlook PST archives into msgvault,
complementing the existing MBOX, EMLX, and IMAP sources.
New files:
- internal/pst/reader.go: thin wrapper around mooijtech/go-pst v6 with
folder traversal, message extraction, attachment reading, FILETIME→time.Time
conversion, and Exchange DN resolution
- internal/pst/mime.go: reconstructs RFC 5322 MIME from PST messages —
uses TransportMessageHeaders verbatim when present (~80% of messages),
falls back to synthesizing headers from MAPI properties for drafts and
Exchange-native sends
- internal/importer/pst_import.go: import orchestration following the MBOX
importer pattern — batching (200 msg / 32 MiB), checkpoint/resume,
content-hash dedup, cross-folder label merging
- cmd/msgvault/cmd/import_pst.go: CLI command with --skip-folder,
--no-resume, --no-attachments flags and graceful Ctrl+C handling
Usage:
msgvault import-pst you@company.com /path/to/archive.pst
msgvault import-pst you@outlook.com backup.pst --skip-folder "Deleted Items"
Dependency: github.com/mooijtech/go-pst/v6 (Apache 2.0, pure Go)
Additional changes squashed in:
- test: add PST integration tests using go-pst sample files
- fix: set PST source display_name to filename on import
- fix: address 11 code review issues in PST import
- fix: address 5 automated review issues in PST import
- remove plan document, fix errcheck lint failures
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds
import-pst, a new CLI command to import Microsoft Outlook PST files into msgvault. Complements the existing MBOX, EMLX, and IMAP importers.What's new
msgvault import-pst <identifier> <file.pst>— imports all email messages from a PST archive; calendar items, contacts, tasks, and notes are skipped automaticallyInbox,Sent Items)--no-resumeto start fresh--skip-folderflag to exclude folders (e.g.--skip-folder "Deleted Items")--no-attachmentsflag to skip attachment importTransportMessageHeadersverbatim when present (~80% of messages); synthesizes RFC 5322 headers from MAPI properties for drafts and Exchange-native sendsSecurity fixes included
Dependencies
Adds
github.com/mooijtech/go-pst/v6(Apache 2.0, pure Go).Usage
msgvault import-pst you@company.com /path/to/archive.pst msgvault import-pst you@outlook.com backup.pst --skip-folder "Deleted Items" msgvault import-pst you@outlook.com backup.pst --no-resume