What is Mail Deduplicate?
Provides the mdedup CLI, an utility to deduplicate mails from a set of boxes.
Features
- Duplicate detection based on cherry-picked and normalized mail headers.
- Fetch mails from multiple sources.
- Reads and writes to
mbox,maildir,babyl,mh,mmdfandemlformats. - Deduplication strategies based on size, timestamp, file path or random choice, chainable as fallbacks.
- Copy, move, delete or hardlink the resulting set of duplicates.
- Dry-run mode.
- Protection against false-positives with safety checks on size and content differences.
- Optional cache reusing the hashes computed by previous runs.
- Parallel hashing and selection over several processes.
- Supports macOS, Linux and Windows.
- Standalone executables for Linux, macOS and Windows.
- Shell auto-completion for Bash, Zsh and Fish.
Installation
All installation methods are available in the documentation. Below are the most popular ones:
Try it now
uv is the fastest way to run mdedup on any platform, thanks to its uvx command:
$ uvx --from mail-deduplicate -- mdedup
macOS
mdedup is part of the official Homebrew default tap, so you can install it with:
$ brew install mail-deduplicate
Executables
Standalone binaries of mdedup's latest version are available as direct downloads for several platforms and architectures:
| Platform | arm64 |
x86_64 |
|---|---|---|
| Linux | Download mdedup-linux-arm64.bin |
Download mdedup-linux-x64.bin |
| macOS | Download mdedup-macos-arm64.bin |
Download mdedup-macos-x64.bin |
| Windows | Download mdedup-windows-arm64.exe |
Download mdedup-windows-x64.exe |
Quickstart
Duplicate mails pile up whenever boxes get copied around: backups of the same account taken at different times, per-folder exports where a mail tagged with several labels lands in several boxes, archives consolidated from multiple clients, or IMAP synchronizations gone wrong.
mdedup cleans this up. Point it at your boxes: it groups copies of the same mail by hashing a curated set of headers, applies a --strategy to pick which copy to keep in each group, then performs an --action on the result. The default action is the safest one: sources are only read, and the deduplicated selection is written to a brand new box.
So to merge two overlapping archives into a single clean box:
$ mdedup --strategy select-one --export merged.mbox archive-2024.mbox archive-2025.mbox
Mails found in both archives are copied once into merged.mbox, along with all the mails that were unique to each source.
To remove duplicates in place instead, switch to a destructive action, and rehearse with --dry-run:
$ mdedup --strategy select-one --action delete-discarded --dry-run ~/Maildir
The hands-on tutorial builds a small playground of duplicated mails, then walks through strategies, actions and safeguards on it. The design page explains how duplicates are detected.
[!NOTE] Memory does not grow with the size of your boxes: each mail is reduced to a lightweight stub as soon as it is hashed, so a 215 MB maildir of 1,500 mails peaks at 46 MB. It does grow with their number, at roughly 1 KB of resident memory each, so a large enough collection can still exhaust your machine.
Hashing is where a run spends most of its time, and
--cachereuses it between runs. The performance page covers both, and how to manage that cache.
You can support this project with pull requests, business support 🤝 and sponsorship 🫶.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mail_deduplicate-9.3.0.tar.gz.
File metadata
- Download URL: mail_deduplicate-9.3.0.tar.gz
- Upload date:
- Size: 65.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91da1ef5da2d22f125afaeea36a59aa8301707a3843361cce63081e416ef486e
|
|
| MD5 |
01d71d4d8c0971cfd6dcb2d51f93bb85
|
|
| BLAKE2b-256 |
f9c9a80d901668896b00d20aab80c91c02cafdd203134245acc8c74099b4a1c7
|
Provenance
The following attestation bundles were made for mail_deduplicate-9.3.0.tar.gz:
Publisher:
release.yaml on kdeldycke/mail-deduplicate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mail_deduplicate-9.3.0.tar.gz -
Subject digest:
91da1ef5da2d22f125afaeea36a59aa8301707a3843361cce63081e416ef486e - Sigstore transparency entry: 2385012735
- Sigstore integration time:
-
Permalink:
kdeldycke/mail-deduplicate@801d04bcf4679e244170b1efb8650df0ce51006f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kdeldycke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@801d04bcf4679e244170b1efb8650df0ce51006f -
Trigger Event:
push
-
Statement type:
File details
Details for the file mail_deduplicate-9.3.0-py3-none-any.whl.
File metadata
- Download URL: mail_deduplicate-9.3.0-py3-none-any.whl
- Upload date:
- Size: 66.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e57af1c03204b7886fbf5a404884e7335a1c1fc852932d39322d64e9541b891
|
|
| MD5 |
e01c36b6e78e256e49d267b785ca6dfd
|
|
| BLAKE2b-256 |
70b7c0d3ee9819901db9185bd26d907c643946d88b24f6ada59ea8ed4fdcc700
|
Provenance
The following attestation bundles were made for mail_deduplicate-9.3.0-py3-none-any.whl:
Publisher:
release.yaml on kdeldycke/mail-deduplicate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mail_deduplicate-9.3.0-py3-none-any.whl -
Subject digest:
7e57af1c03204b7886fbf5a404884e7335a1c1fc852932d39322d64e9541b891 - Sigstore transparency entry: 2385011898
- Sigstore integration time:
-
Permalink:
kdeldycke/mail-deduplicate@801d04bcf4679e244170b1efb8650df0ce51006f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kdeldycke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@801d04bcf4679e244170b1efb8650df0ce51006f -
Trigger Event:
push
-
Statement type: