DOVEADM-PURGE(1)
π DOVEADM-PURGE(1) β the doveadm purge glow-up
okay bestie, gather round, because this is the Dovecot manual page for doveadm-purge, and it's genuinely so useful. sit down, hydrate, and let's get into it π«Ά
β¨ NAME β¨
doveadm-purge β remove messages with refcount=0 from mdbox files
β¨ SYNOPSIS β¨
doveadm [GLOBAL OPTIONS] purge [-S socket_path] -A
doveadm [GLOBAL OPTIONS] purge [-S socket_path] -F file
doveadm [GLOBAL OPTIONS] purge [-S socket_path] --no-userdb-lookup
doveadm [GLOBAL OPTIONS] purge [-S socket_path] -u user
β¨ DESCRIPTION β¨
so the doveadm purge command is literally here to remove all messages with refcount=0 from a user's mail storage. and when does a message hit refcount=0, you ask? it happens when the user β or some administration utility β has expunged every single instance of that message from all mailboxes. at that point the refcount drops to 0, and it's giving "this message has no more friends, it can go". π¦
and now, the four forms, one by one:
- in the first form, the command will be executed for all users. everybody. the whole squad.
- in the second form, the command will be executed for all users listed in the given file.
- in the third form, the command will be performed for the user contained in the
USERenvironment variable. - in the last form, only messages of the given user(s) will be purged. selective. main character energy. π
β¨ GLOBAL OPTIONS β¨
these are the global doveadm(1) options, bestie β they apply across the board:
-Dβ enables verbosity and debug messages. it's giving loud and proud. π₯-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. (yes, that's a lot of defaults, be brave)-kβ preserve the entire environment fordoveadm, not just theimport_environmentsetting. lowkey important.-vβ enables verbosity, including a progress counter. so satisfying to watch ngl π-iinstance-name β if you're using multiple Dovecot instances, choose the config file based on this instance name. see theinstance_namesetting for more information.-cconfig-file β read configuration from the given config-file. by default it first reads config socket, and then falls back to/etc/dovecot/dovecot.conf. you can also point this to the config socket of some instance running a compatible version. iconique.-osetting=value β overrides the configuration setting from/etc/dovecot/dovecot.confand from the userdb with the given value. in order to override multiple settings, the-ooption may be specified multiple times. stack 'em. π
β¨ OPTIONS β¨
-Aβ if the-Aoption is present, the command will be performed for all users.
okay so real talk: 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. π not the low-UID jump scare.
when the SQL userdb module is used, make sure that the userdb_sql_iterate_query setting setting matches your database layout. (yes, the original says "setting setting", and we respect the original, periodt.)
when using the LDAP userdb module, make sure that the userdb_fields setting and userdb_ldap_iterate_fields setting settings match your LDAP schema. otherwise doveadm(1) will be unable to iterate over all users. π
-Ffile β 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. π--no-userdb-lookupβ do not perform userdb lookup. use theUSERenvironment variable to specify the username.-Ssocket_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 a remote host via a TCP socket.
this allows an administrator to execute doveadm(1) mail commands through the given socket. remote girlies, this one's for you π
-uuser/mask β run the command only for the given user. it's also possible to use'*'and'?'wildcards (e.g.-u *@example.org). wildcard slay. β¨
β¨ REPORTING BUGS β¨
found a bug? π report bugs, including doveconf -n output, to the Dovecot Mailing List β¨dovecot@dovecot.orgβ©. information about reporting bugs is available at: β¨https://dovecot.org/bugreport.htmlβ©. include the doveconf -n output fr fr, they need it.
β¨ SEE ALSO β¨
additional resources:
- dbox
and that's the whole page bestie, no cap, you ate it π
this was DOVEADM-PURGE(1) from Dovecot, source version f979264, dated April 2026. periodt. π
π¦ 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