Sync exported WhatsApp .txt (or .zip) chats into your own mailbox. Each chat
becomes an email thread under a WhatsApp/<Chat Name> label/folder, with messages
rendered as a readable, WhatsApp-style HTML conversation (inline images, attached
media). Mail is delivered over IMAP with an app password, which works with any
provider: Gmail, Yahoo, iCloud, Fastmail and more.
Currently supports WhatsApp chat exports. The name does not box the app in: other chat sources can be added without another rename.
Chat Mail Sync is an Android app, written in Kotlin with a
Compose interface. It needs Android 11 or newer on a 64-bit ARM phone
(arm64-v8a). The sync engine is Kotlin and the app contains no Python.
Looking for the non-technical user guide? See docs/user-guide.md.
| Route | Notes |
|---|---|
| GitHub releases | The signed APK. Use Obtainium to be told about updates. |
| Xiaomi GetApps | Install and update like any store app, on a Xiaomi, Redmi or POCO phone or any phone with GetApps. |
| PhonePe Appstore | Available there; search for Chat Mail Sync. |
| Google Play | Closed test for now, not yet open to everyone. |
| F-Droid | Inclusion is in review. It is not on F-Droid yet. |
Every build from the GitHub release, GetApps, PhonePe Appstore and Google Play is signed with the project's own release key, and that key never changes, so updates install cleanly over each other. An APK signed with a different key, such as the F-Droid build once it exists, cannot be installed over one of these. Moving between them means uninstalling first, so save a backup first: see docs/switching-to-fdroid.md.
A bare APK never tells you when it is out of date. Obtainium is a free, open-source app installer that tracks a project's releases and offers you the update as soon as one is published.
If Obtainium is already on your phone, tap this badge. It opens Add App with everything filled in, so you can skip to step 3.
- Install Obtainium (itself available from F-Droid or its own releases page).
- In Obtainium, tap Add App and paste
https://github.com/harshalambani/ChatMailSync. - Install. Obtainium will notify you of every future release.
There is nothing to obtain from a provider console. Create an app-specific password at your mail provider (Gmail: https://myaccount.google.com/apppasswords), then open Settings > Mail account in the app, pick your provider (which fills in host and port), enter the address and the app password, and tap Connect.
Messages flow from a drop folder, through a parser and deduplication layer, into your mailbox over IMAP:
inbox -> parser -> dedup (SQLite) -> mail push (IMAP APPEND)
- Messages are added with
APPEND, never sent. Nothing leaves your mailbox and no sending quota is consumed. - Per-chat sync state lives in a SQLite database on the phone; re-running a sync only pushes new messages. That state is per-instance, not per-mailbox: it sits next to the instance that wrote it, and nothing about it reaches the mailbox. Use one instance per mailbox. Any second instance pointed at the same account knows nothing about what the first sent and re-archives the same chats. That is any second instance: another phone, or a reinstall that did not restore its data. The app can add mail but never remove it, so the cleanup is manual. Replacing an instance is fine: carry the backup across.
- A fully successful sync deletes the app's copy of the export from its inbox; no copy is kept. A file that could not be read stays in the inbox and is reported.
- Every provider caps the size of a single message (25 MB at Gmail/Yahoo,
20 MB at iCloud; RFC 7889
APPENDLIMITis honoured when advertised, and a refusal in flight lowers the ceiling for the rest of the run). A chunk that would exceed it is split; MIME encoding inflates raw bytes by roughly x1.37, so the projection is done on encoded size, not raw. One case cannot be split: a single media file larger than the cap on its own. That message is still archived, with a placeholder naming the file and its size in place of the media, and the file is reported in the sync summary under media omitted. The original stays in the WhatsApp export; nothing is lost, but it will never sync. - An optional watched folder (
WatchFolderWorker.kt) copies new exports into the inbox on its own. The scan is non-recursive, each source is imported once and ledgered by path, and the synced-file policy (leave, move tosynced/, or delete) is applied only once delivery is confirmed, never at import time. It runs as a WorkManager job with a 15-minute floor.
Timezone note: WhatsApp exports carry no timezone information; timestamps are stored as naive local times. If your phone's timezone changed between exports, some timestamps may appear shifted.
For the full original design (date parsing, state schema, dedup logic, HTML and media email format) see Completed/2026-05-27-architecture.md. It describes the Python reference implementation and is kept as history.
The app asks for a mail password and reads an entire chat history, so what it does with both is stated plainly. The in-app privacy text and the hosted privacy policy are the full statement.
The password stays on the Kotlin side, encrypted with an AndroidKeyStore AES/GCM
key that never leaves secure storage (SecretStore.kt), and is handed to the
sync engine only at call time. It is never pre-filled back into the password
field, never written to a log line, never put into an exception message, and
never passed through WorkManager data.
What that does and does not defend against:
- Per-app sandboxing: Android isolates the app's files from every other app on the device.
- The KeyStore key is not extractable, so even a copy of the app's files does not hand over a usable key.
- Offline disk reads (a backup, a forensic image) yield ciphertext, not the password.
- It does not defend against a compromised or rooted device. This is at-rest protection, not a defence against a device that is no longer trustworthy.
Use an app-specific password, never your account password: it reaches only the mail service rather than your whole account, and it can be revoked at the provider without changing anything else. It is not scoped to a subset of mail operations, which is why the next section matters.
The app only ever adds mail: it does not read, delete, move or send. An app-specific password is a bearer credential, and no provider lets you restrict one to "append only", so the guarantee is a promise the app's own code keeps, backed by a command surface small enough to audit by eye.
ImapTransport in android/core/src/main/kotlin/com/chatmailsync/core/mail/
issues exactly four mailbox commands over its whole lifetime: LIST, CREATE,
SUBSCRIBE, APPEND, plus LOGIN and LOGOUT around them. There is no
SELECT, FETCH, STORE, SEARCH, EXPUNGE, COPY or MOVE anywhere in
that package's IMAP code, and without SELECT the connection never enters the
IMAP state in which a message can be read or flagged at all. The source is
public and it takes about a minute to verify.
IMAP connections use TLS with certificate and hostname verification and carry socket timeouts; a failed verification refuses to send credentials rather than falling back to an unverified session. Settings and password are saved only after the app has signed in and created (or found) its WhatsApp folder.
A Gmail-only Google sign-in path existed until v2.0.0. It went because it was
practically unusable, not because it was less secure. The OAuth client never left
Google's Testing publishing status; publishing it would require Google's
verification for the restricted gmail.insert scope, which hinges on an annual
paid security assessment, which is not worth it for a personal tool. Testing
status limits sign-in to at most 100 listed test users and expires every consent
after 7 days. IMAP has neither limit. It was demoted in v1.6.0 and removed in
v2.0.0; putting it back is documented in
docs/RESTORING-OAUTH.md.
The repository is an Android project plus a frozen Python reference.
.
├── android/ # The app. Gradle modules :app (Compose UI, WorkManager) and :core (plain Kotlin/JVM sync engine)
├── src/ # Python reference implementation. FROZEN: not shipped, kept for golden fixtures and tests
├── tests/ # Python test suite (guards and cross-language parity checks)
├── tools/ # Dev and build helper scripts (golden-fixture generation and checking)
├── docs/ # User guide, release process, privacy policy, site
├── fastlane/ # Store listing text, screenshots and per-version changelogs
├── requirements*.txt
└── AGENTS.md # Instructions for coding agents and contributors
- The Python code in
src/is the frozen reference: the Kotlin engine was ported from it and is checked against golden files it produced. Fixes go in Kotlin only; the Python is not changed. - Toolchain, build and test commands, and the project's house rules are in AGENTS.md. Release steps are in docs/RELEASING.md.
- A Windows desktop app existed alongside the Android app and ended at v2.1.5
(tag
windows-final); the repo is Android-only from here on.
Quick start (from the repository root):
cd android
./gradlew :app:testDebugUnitTest :core:test # use gradlew.bat on Windows
./gradlew :app:assembleRelease # unsigned unless keystore.properties exists
Chat Mail Sync is free software under the GNU General Public License, version 3. See LICENSE for the full text.
In short: you may use, study, modify and redistribute it. If you distribute a modified version, that version must also be GPL-3.0 and its source must be available.
That is a deliberate choice for an app of this kind rather than a default. Chat Mail Sync asks for a mail password and reads an entire chat history, and the only real reason to trust it is that you can read exactly what it does with both. A permissive licence would allow someone to ship a closed, unverifiable fork under a similar name and inherit that trust without earning it. Copyleft means every descendant of this code stays as readable as this one.
The APK also embeds several third-party components under their own (non-GPL) licences: AndroidX/Jetpack Compose, the Kotlin stdlib and kotlinx.coroutines. The app bundles no Python runtime and no Python packages. See NOTICE for the full list and licence texts; the same content is bundled into the app itself, reachable from Settings > Help > Open-source licences.