DOVEADM-BATCH(1)
β¨ NAME β¨
doveadm-batch β run a whole bunch of commands for a whole bunch of users, bestie π
πΈ SYNOPSIS πΈ
doveadm [-Dv] batch [-S socket_path] -A sep command sep command [...]
doveadm [-Dv] batch [-S socket_path] -F file sep command sep command [...]
doveadm [-Dv] batch [-S socket_path] -u usermask sep command sep command [...]
π¦ DESCRIPTION π¦
okay so doveadm batch is that girl π
she runs multiple doveadm(1) commands sequentially for multiple users. and like, the whole point is optimization β Dovecot gets to do all the mailbox operations for the same user in one go, instead of dragging itself through the users over and over again. it's giving efficiency, it's giving main character energy π
There are three forms, and they're all lowkey iconic:
- First form:
doveadm(1)loops over all the users defined in the configureduser_db(s), and runs the sequence of commands for each one of them. - Second form:
doveadm(1)loops over all the users listed in the given file. - Third form: the commands get executed for each user matching the given
usermask.
periodt. β¨
π OPTIONS π
Global doveadm(1) options β these are the universal ones, the basics, the essentials:
-Dβ turns on verbosity and debug messages. she's chatty fr fr π£οΈ-o setting=valueβ overrides the configuration setting from/etc/dovecot/dovecot.confand from the userdb, using the value you give it. wanna override multiple settings? no stress, just pass-oas many times as you want π-vβ enables verbosity, including a progress counter. watching that counter go up? obsessed. π
Command specific options β these ones are just for batch:
-Aβ if-Ais present, the command gets performed for all users. > heads up bestie: using this together with system users fromuserdb { driver = passwd }is not recommended, because that userdb also contains users with a lower UID than the one configured with thefirst_valid_uidsetting π
also, when the SQL userdb module is in play, make sure the iterate_query setting in /etc/dovecot/dovecot-sql.conf.ext matches your database layout. and if you're on the LDAP userdb module, make sure the iterate_attrs and iterate_filter settings in /etc/dovecot/dovecot-ldap.conf.ext match your LDAP schema. otherwise doveadm(1) literally cannot iterate over all users and it will just... not. π
-F fileβ execute the command for all the users in the file. it's similar to the-Aoption, except instead of pulling the user list from the userdb, they get read from the given file. the file contains one username per line. simple as that π-S socket_pathβ the argument here 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 executedoveadm(1)mail commands through the given socket π₯-u user/maskβ run the command only for the given user. you can also use'*'and'?'wildcards (e.g.-u *@example.org) π¦
and now the important bit: when neither the -A option, nor the -F file option, nor the -u user was specified, the command gets executed with the environment of the currently logged in user. iykyk π
π ARGUMENTS π
commandβ anydoveadm(1)command, with arguments and options β except for the-A,-Sand-uoptions. those are off limits here, bestie πsepβ a single character used as the command separator, e.g.':'. > be careful tho: unquoted characters, like;or&, may get interpreted by your shell and thendoveadm(1)will never see them. and then you'll be sad. don't be sad. π
β EXAMPLE β
In this example we move seen mails, older than one month, for all example.net users to the alternative storage under /nfsmount:
mail_location = mdbox:~/mdbox:ALT=/nfsmount/%h/mdbox
The second command will remove messages with refcount=0 from the primary storage.
doveadm batch -u \*@example.net : altmove seen savedbefore 30d : purge
look at her go. absolutely ate. π₯
π REPORTING BUGS π
found a bug? report it, including your doveconf -n output, to the Dovecot Mailing List <dovecot@dovecot.org>. info about reporting bugs lives at: http://dovecot.org/bugreport.html π«Ά
π SEE ALSO π
and that's the whole page, bestie!! this one comes to you from Dovecot v2.3, dated 2015-05-09 β yes she's an older icon but she still serves π β¨
π¦ where this page comes from
- arch rolling: dovecot23 2.3.21.1-5 Β· MIT AND LGPL-2.1-only
- centos-stream 10: dovecot 1:2.3.21-22.el10 Β· MIT AND LGPL-2.1-only
- centos-stream 9: dovecot 1:2.3.16-21.el9 Β· MIT and LGPLv2
- centos-stream 9: dovecot 1:2.3.16-21.el9 Β· MIT and LGPLv2
- debian bookworm: dovecot-core 1:2.3.19.1+dfsg1-2.1+deb12u6 Β· LGPL-2.1-only
- debian bookworm: dovecot-core 1:2.3.19.1+dfsg1-2.1+deb12u7 Β· LGPL-2.1-only
- ubuntu jammy: dovecot-core 1:2.3.16+dfsg1-3ubuntu2 Β· LGPL-2.1-only
- ubuntu jammy: dovecot-core 1:2.3.16+dfsg1-3ubuntu2.9 Β· LGPL-2.1-only
- ubuntu noble: dovecot-core 1:2.3.21+dfsg1-2ubuntu5 Β· LGPL-2.1-only
- ubuntu noble: dovecot-core 1:2.3.21+dfsg1-2ubuntu6.5 Β· LGPL-2.1-only
- Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms