Shipping a Flutter Desktop Email Archiver on the Microsoft Store (MSIX, Native Dart IMAP, PDF & MBOX)

If you have ever hit the storage limit on an IMAP mailbox (Gmail, Outlook, Aruba, custom business domains, or Italian PEC accounts), you know the usual choices on Windows:
- Pay for another monthly storage upgrade forever, or
- Spend an afternoon juggling desktop mail clients, proprietary
.pstfiles, and fragile export plugins — hoping you don't accidentally delete emails before verifying they were actually saved.
I wanted something dead simple, 100% local, and one-time priced — so I built Archivia Mail in Flutter and just shipped version 1.5.0 on the Microsoft Store for Windows 10/11 (alongside iPhone, iPad, and macOS).
Here is what it does on Windows and a few lessons from packaging a Flutter desktop app as an MSIX for the Microsoft Store.
What Archivia Mail does on Windows
Everything runs locally on your PC — no intermediate servers, no account to register, no ads, and passwords are never written to disk:
- Connects directly via IMAP (auto-discovering settings for Gmail, Outlook/Hotmail via Microsoft OAuth, Aruba, Italian PEC as personal local backup, iCloud, Yahoo, Alice Mail, custom domains, etc.).
- Saves a clean local archive in
Downloads › Mail Archive(organized by account → folder →YYYY-MM):- A readable PDF per email (with sender, recipients, date, subject, body, and CJK/Unicode font support)
- Extracted attachments right next to the PDF
- Original
.emlcopies openable in any mail client
- "Conversations as one PDF" — merges entire reply threads chronologically into a single readable PDF (with optional quote hiding).
- Portable
.mboxexport & mailbox migration — export any archived folder as standard.mboxfor Thunderbird / Apple Mail, or upload archived emails directly into another IMAP mailbox with the same folders and zero duplicates. - Verified server cleanup — by default, no email ever leaves the server unless it is verified on disk with all its files. Every message is tracked by
folder + UIDVALIDITY + UID, re-checked before touching the server, and deleted strictly viaUID EXPUNGE. If even a single file is missing, nothing is touched. - New in v1.5.0 (live now on Microsoft Store):
- Saved Mailboxes list on the login screen (stores only server settings & address — never the password)
- Refresh mailbox button directly on the home screen
- Alice Mail STARTTLS (port 143) preset
3 engineering choices that saved a lot of pain on Windows
1. Custom IMAP client in pure Dart (dart:io) — no connection pools, no IDLE
Because Archivia Mail is an on-demand archiver rather than an always-on mail client, skipping persistent connection pooling and IDLE avoided almost every cross-platform keep-alive headache:
- Each job opens a single dedicated
SecureSocket.connect(IMAPS) orSecureSocket.secure(afterSTARTTLS) with strict certificate verification (noonBadCertificatebypass) and closes cleanly withLOGOUT. - For long archiving runs where servers randomly drop sockets, a small retry wrapper reconnects with backoff, re-selects the folder, re-checks
UIDVALIDITY, and resumes from the exact sameUID— while stopping immediately on rate-limit/bandwidth refusals. - For Outlook/Hotmail OAuth, Microsoft drops the IMAP session the moment the access token expires, so the client proactively rotates the connection ~10 minutes before expiry (
authValidUntil) so big attachments never get cut off mid-transfer. - Supporting
COMPRESS=DEFLATE(RFC 4978) when advertised speeds up attachment-heavy folders dramatically.
2. Packaging Flutter Desktop for the Microsoft Store with msix
Turning a flutter build windows --release into a Store-ready MSIX was smoother than expected once a couple of subtleties were sorted out:
- Using
msixinpubspec.yamlwithstore: truebuilds the unsigned Store package (Microsoft signs it during certification). - Setting
trim_logo: falsepreventedmsixfrom aggressively cropping our square app icon. - Passing
--build-windows falseafterflutter build windows --releaseavoided compiling the C++ runner twice. - Because Flutter desktop apps on Windows declare
runFullTrustin the generatedAppxManifest.xml, Partner Center asks for a short technical justification in Submission options — explaining clearly that the app writes the user's PDF/attachment/.emlarchive directly toDownloads\Mail Archivegot both our initial release (1.4.0) and v1.5.0 through certification cleanly in ~24 hours.
3. Single Flutter codebase across Windows, macOS, iOS, and Android
Keeping all core logic (IMAP parser, MIME decoder, PDF generator running in a background Isolate, thread merger, .mbox exporter) in pure Dart means fixes and user-requested features ship everywhere at once. All three features in v1.5.0 came straight from a user's feedback and landed on Windows, Mac, iPhone, and iPad within 48 hours.
Try it on Windows (or Apple)
- Microsoft Store (Windows 10/11 — $0.99 / €1.09 one-time, no subscription): https://apps.microsoft.com/detail/9P8HW1LB8QZN
- Website & all platforms (iPhone, iPad, Mac live; Android launching publicly soon): https://archiviamail.pages.dev
Happy to answer any questions about Flutter Windows desktop builds, MSIX certification, or writing an IMAP client from scratch in Dart!