DOVEADM-DEDUPLICATE(1)
π DOVEADM-DEDUPLICATE(1) π
ok so bestie, we're in the Dovecot manual, section 1, and this is the whole entire glow-up of doveadm-deduplicate. buckle up π
β¨ NAME β¨
doveadm-deduplicate β expunge duplicate messages π
that's it. that's the job. and she ate.
π¦ SYNOPSIS π¦
doveadm [GLOBAL OPTIONS] deduplicate [-u user | -A | -F file | --no-userdb-lookup] [-S socket_path] [-m] search_query
π DESCRIPTION π
So this command exists to expunge duplicated messages in mailboxes. no cap.
doveadm deduplicate is mainly useful for reverting some (more or less) accidental duplication of messages β like, say, after a doveadm copy or a doveadm import. we've all been there π.
Here's the tea, and it's important: doveadm(1) will delete the newest duplicated messages from the mailbox and keep the oldest. oldest stays, newest gets yeeted. periodt.
β οΈ Deduplication across multiple mailboxes is not supported. not a vibe, but it's the rules.
πΈ GLOBAL OPTIONS πΈ
these are the global doveadm(1) options β the universal ones every command shares:
-Dβ enables verbosity and debug messages. she's chatty and we love her π¬-Oβ do not read any config file, just use defaults. Thedovecot_storage_versionsetting defaults to the latest version, but it can be overridden with-o.-kβ preserve the entire environment fordoveadm, not just theimport_environmentsetting.-vβ enables verbosity, including a progress counter. progress bar moment β¨-i instance-nameβ if you're using multiple Dovecot instances, choose the config file based on this instance name. See theinstance_namesetting for more information.-c config-fileβ read configuration from the given config-file. By default it first reads the config socket, and then falls back to/etc/dovecot/dovecot.conf. You can also point this at the config socket of some instance running a compatible version.-o setting=valueβ overrides the configuration setting from/etc/dovecot/dovecot.confand from the userdb with the given value. To override multiple settings, the-ooption may be specified multiple times. stack 'em, bestie π«Ά
π OPTIONS π
-Aβ if the-Aoption is present, the command will be performed for all users. Using this option in combination with system users fromuserdb { driver = passwd }is not recommended, because it contains also users with a lower UID than the one configured with thefirst_valid_uidsetting. π When the SQL userdb module is used, make sure that theuserdb_sql_iterate_querysetting matches your database layout. When using the LDAP userdb module, make sure that theuserdb_fieldssetting and theuserdb_ldap_iterate_fieldssetting match your LDAP schema. Otherwisedoveadm(1)will be unable to iterate over all users. no pressure tho π-F fileβ execute the command for all the users in the file. This is similar to the-Aoption, but instead of getting the list of users from the userdb, they are read from the given file. The file contains one username per line. one per line, don't get cute.--no-userdb-lookupβ do not perform userdb lookup. Use theUSERenvironment variable to specify the username.-mβ if the-moption is given,doveadm(1)will deduplicate by theMessage-Idheader. By default deduplication will be done by message GUIDs. pick your fighter βοΈ-S socket_pathβ the option's argument is either an absolute path to a local UNIX domain socket, or a hostname and port (hostname:port), in order to connect to a remote host via a TCP socket. This allows an administrator to executedoveadm(1)mail commands through the given socket. π remote slay.-u user/maskβ run the command only for the given user. It's also possible to use'*'and'?'wildcards (e.g.-u *@example.org). wildcard girlies rise π¦
β ARGUMENTS β
search_queryβ expunge duplicates found from messages matching the given search query. Typically a search query like'mailbox mailbox_name OR mailbox other_box'will be sufficient. Seedoveadm-search-query(7)for the details. iykyk.
π EXAMPLE π
This example shows how to list and expunge duplicate messages from a mailbox. watch the glow-up in real time:
doveadm -f table fetch -u jane 'guid uid' mailbox a_Box | sort
guid uid
8aad0f0a30169f4bea620000ca356bad 18751
8aad0f0a30169f4bea620000ca356bad 18756
923e301ab9219b4b4f440000ca356bad 18748
923e301ab9219b4b4f440000ca356bad 18753
doveadm deduplicate -u jane mailbox a_Box
doveadm -f table fetch -u jane 'guid uid' mailbox a_Box | sort
guid uid
8aad0f0a30169f4bea620000ca356bad 18751
923e301ab9219b4b4f440000ca356bad 18748
a7999e1530739c4bd26d0000ca356bad 18749
see how the dupes just... left? π the oldest of each pair stayed, the newest got expunged. exactly as described, no notes.
π REPORTING BUGS π
Found a bug? Report bugs β and please, please include your doveconf -n output π β to the Dovecot Mailing List β¨dovecot@dovecot.orgβ©. Information about reporting bugs is available at: β¨https://dovecot.org/bugreport.htmlβ©
π SEE ALSO π
and that's the whole page, bestie π This one comes from the Dovecot source, revision f979264, dated April 2026. now go forth and deduplicate responsibly, main character πβ¨
π¦ where this page comes from
- alpine 3.23: dovecot-doc 2.4.5-r0 Β· MIT AND LGPL-2.1-or-later
- alpine 3.24: dovecot-doc 2.4.5-r0 Β· MIT AND LGPL-2.1-or-later
- arch rolling: dovecot 2.4.5-1 Β· MIT AND LGPL-2.1-only
- fedora 43: dovecot 1:2.4.5-1.fc43 Β· MIT AND LGPL-2.1-only
- fedora 44: dovecot 1:2.4.5-1.fc44 Β· MIT AND LGPL-2.1-only
- nixos 26.05: dovecot 2.4.5
- nixpkgs unstable: dovecot 2.4.5
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms