Files
scriptory/README.md

41 lines
1.7 KiB
Markdown
Raw Normal View History

2026-08-27 12:09:45 -07:00
# Scriptory
## Bulk Outlook email import
Export any number of messages from Outlook into `~/Seafile/buffer/mail/`. Outlook's subject-based
filenames and numeric collision suffixes do not matter; the importer reads each email's headers and
content hash.
Import all new messages:
```bash
~/Seafile/tower/repo/scriptory/import-outlook-mail.py
```
The default canonical destination is `~/Seafile/doc/job/Parallels/mail/`. Messages are grouped by
the year and month of the email's `Date` header. A normal filename is
`YYYYMMDD-HHMMSSZ-subject.eml`; the timestamp is normalized to UTC when the header includes a
timezone. A short SHA-256 suffix is added only if a different message already has the same generated
filename. Unknown or invalid dates are stored under `unknown-date/`.
The importer regenerates `index.csv` from the archive with the full SHA-256, selected normalized
header values, and archive path. Its duplicate rules are:
- An existing SHA-256 is an exact duplicate and is skipped.
- A repeated `Message-ID` with different bytes is preserved and reported as a variant.
- A repeated subject alone is not a duplicate.
Each new message is copied to a temporary file beside its final destination, SHA-256 verified, and
then published without overwriting an existing file. Files in `~/Seafile/buffer/mail/` are never
modified or deleted. Clear the buffer manually only after confirming that Seafile has synchronized
the canonical archive.
Only `.eml` files are imported. Other files are reported as unsupported, left untouched, and cause a
nonzero exit so they are not missed before the buffer is cleared. To use different directories:
```bash
~/Seafile/tower/repo/scriptory/import-outlook-mail.py \
--source /path/to/export \
--archive /path/to/archive
```