DOVEADM-ALTMOVE(1)
π DOVEADM-ALTMOVE π
okay so bestie, we're doing the doveadm-altmove page, which is part of doveadm(1) in the Dovecot fam. she's a little niche but she's so useful, i promise.
β¨ NAME β¨
doveadm-altmove β move matching mails to the alternative storage (dbox-only, so don't come here with your mbox nonsense, she's exclusive π
)
πΈ SYNOPSIS πΈ
doveadm [GLOBAL OPTIONS] altmove [-r] [-S socket_path] -A search_query
doveadm [GLOBAL OPTIONS] altmove [-r] [-S socket_path] -F file search_query
doveadm [GLOBAL OPTIONS] altmove [-r] [-S socket_path] --no-userdb-lookup search_query
doveadm [GLOBAL OPTIONS] altmove [-r] [-S socket_path] -u user search_query
like, four whole fits and she serves in every single one π
π¦ DESCRIPTION π¦
so the tea is: this command works with sdbox or mdbox storage, and it moves mails over to the alternative storage path β but ONLY if mail_alt_path is actually specified for the mail location. no path, no move, that's the rule π«Ά
and here's how the four forms go, because the way she reads who she's doing this for is literally different every time:
- first form β
doveadm(1)runs thealtmovefor ALL the users. everyone. the whole server. group chat, no exclusions. - second form β the command gets performed for all users listed in the given file.
- third form β the command gets performed for the user sitting inside the
USERenvironment variable. - last form β only the matching mails of the given user(s) get moved to the alternative storage.
π GLOBAL OPTIONS π
the global doveadm(1) options, aka the ones that apply everywhere:
-Dβ turns on verbosity AND debug messages. she's chatty now, she's telling you everything.-Oβ do NOT read any config file, just roll with defaults. thedovecot_storage_versionsetting defaults to the latest version, but you can override it with-o.-kβ preserve the entire environment fordoveadm, not just theimport_environmentsetting. keeping the whole vibe intact, no cap.-vβ enables verbosity, including the progress counter. numbers go up, serotonin goes up.-iinstance-name β if you're running multiple Dovecot instances, this picks which config file to use based on the instance name. peep theinstance_namesetting for more info.-cconfig-file β read the configuration from the given config-file. by default it first reads the config socket, then falls back to/etc/dovecot/dovecot.conf. you can also point this at the config socket of some instance running a compatible version.-osetting=value β overrides the configuration setting from/etc/dovecot/dovecot.confand from the userdb with the given value. wanna override multiple settings? just stack the-ooption as many times as you want. iconic behavior.
π OPTIONS π
-Aβ if-Ais present, the command gets performed for all users. > bestie, lowkey a warning: using this together with system users fromuserdb { driver = passwd }is NOT recommended, because that thing also contains users with a lower UID than the one configured with thefirst_valid_uidsetting. π
when the SQL userdb module is in play, make sure the userdb_sql_iterate_query setting matches your database layout.
when you're using the LDAP userdb module, make sure the userdb_fields setting and the userdb_ldap_iterate_fields setting match your LDAP schema. otherwise doveadm(1) will be unable to iterate over all users. she's stuck. she's sad. don't do that to her. π
-Ffile β execute the command for all the users in the file. it's like-Abut instead of pulling the user list from the userdb, she reads them from the given file. one username per line, periodt.--no-userdb-lookupβ do not perform a userdb lookup. use theUSERenvironment variable to specify the username instead.-rβ with-rgiven, this command works the other way round. mails get moved from the alternative storage back to the default mail location. rewind, reverse, rewind π¦-Ssocket_path β the argument is either an absolute path to a local UNIX domain socket, or a hostname and port (hostname:port), so you can connect to a remote host via a TCP socket.
this lets an administrator execute doveadm(1) mail commands through the given socket. remote queen energy.
-uuser/mask β run the command only for the given user. you can also use'*'and'?'wildcards, e.g.-u *@example.org. slay.
π ARGUMENTS π
- search_query β messages matching this search query get moved to alt storage. peep
doveadm-search-query(7)for the details, she explains the whole grammar.
π FILES π
/etc/dovecot/conf.d/10-mail.confβ mailbox locations and namespaces. that's where the vibes live.
β EXAMPLE β
okay this example moves seen mails older than one week to alternative storage under /nfsmount:
mail_driver = mdbox
mail_path = ~/mdbox
mail_alt_path = /nfsmount/%{home}/mdbox
doveadm altmove -u johnd@example.com seen savedbefore 1w<
see how seen and savedbefore 1w< are doing all the work? that's the search query carrying the entire team π
π REPORTING BUGS π
found a bug? report it β and please include your doveconf -n output β to the Dovecot Mailing List β¨dovecot@dovecot.orgβ©. info about reporting bugs lives at: β¨https://dovecot.org/bugreport.htmlβ©
she's not mad, she just wants the config dump. help her help you π«Ά
π SEE ALSO π
that's the whole page bestie, you ate it π stay hydrated, back up your mdbox, and remember: alt storage is not a personality, it's a path β¨
f979264 β April 2026 β Dovecot π (yeah that's the version stamp and the date, screenshot it, put it in the group chat, whatever, mwah π)
π¦ 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