1DOVEADM-BATCH(1) Dovecot DOVEADM-BATCH(1)
2
3
4
6 doveadm-batch - Execute multiple commands for multiple users
7
9 doveadm [-Dv] batch [-S socket_path] -A sep command sep command [...]
10 doveadm [-Dv] batch [-S socket_path] -F file sep command sep command
11 [...]
12 doveadm [-Dv] batch [-S socket_path] -u usermask sep command sep com‐
13 mand [...]
14
16 The command doveadm batch is used to execute multiple doveadm(1) com‐
17 mands sequentially for multiple users. This is primarily an optimiza‐
18 tion where Dovecot can do all the mailbox operations for the same user
19 at once, instead of having to go through the users multiple times.
20
21 In the first form doveadm(1) will loop over all users, defined in the
22 configured user_db(s), and execute the sequence of commands for each of
23 them.
24
25 In the second form doveadm(1) will loop over all users, listed in the
26 given file.
27
28 In the third form the commands will be executed for each user matching
29 the given usermask.
30
32 Global doveadm(1) options:
33
34 -D Enables verbosity and debug messages.
35
36 -o setting=value
37 Overrides the configuration setting from /etc/dovecot/dove‐
38 cot.conf and from the userdb with the given value. In order to
39 override multiple settings, the -o option may be specified mul‐
40 tiple times.
41
42 -v Enables verbosity, including progress counter.
43
44 Command specific options:
45
46 -A If the -A option is present, the command will be performed for
47 all users. Using this option in combination with system users
48 from userdb { driver = passwd } is not recommended, because it
49 contains also users with a lower UID than the one configured
50 with the first_valid_uid setting.
51
52 When the SQL userdb module is used make sure that the iter‐
53 ate_query setting in /etc/dovecot/dovecot-sql.conf.ext matches
54 your database layout. When using the LDAP userdb module, make
55 sure that the iterate_attrs and iterate_filter settings in
56 /etc/dovecot/dovecot-ldap.conf.ext match your LDAP schema. Oth‐
57 erwise doveadm(1) will be unable to iterate over all users.
58
59 -F file
60 Execute the command for all the users in the file. This is sim‐
61 ilar to the -A option, but instead of getting the list of users
62 from the userdb, they are read from the given file. The file
63 contains one username per line.
64
65 -S socket_path
66 The option's argument is either an absolute path to a local UNIX
67 domain socket, or a hostname and port (hostname:port), in order
68 to connect a remote host via a TCP socket.
69
70 This allows an administrator to execute doveadm(1) mail commands
71 through the given socket.
72
73 -u user/mask
74 Run the command only for the given user. It's also possible to
75 use '*' and '?' wildcards (e.g. -u *@example.org).
76 When neither the -A option, nor the -F file option, nor the
77 -u user was specified, the command will be executed with the
78 environment of the currently logged in user.
79
81 command
82 Any doveadm(1) command, with arguments and options — except for
83 the -A, -S and -u options.
84
85 sep A single character used as command separator, e.g. ':'. Be
86 careful, unquoted characters, like ; or &, may be interpreted by
87 your shell and doveadm(1) will never see them.
88
90 In this example we move seen mails, older than one month, for all exam‐
91 ple.net users to the alternative storage under /nfsmount:
92 mail_location = mdbox:~/mdbox:ALT=/nfsmount/%h/mdbox
93 The second command will remove messages with refcount=0 from the pri‐
94 mary storage.
95
96 doveadm batch -u \*@example.net : altmove seen savedbefore 30d : purge
97
99 Report bugs, including doveconf -n output, to the Dovecot Mailing List
100 <dovecot@dovecot.org>. Information about reporting bugs is available
101 at: http://dovecot.org/bugreport.html
102
104 doveadm(1)
105
106
107
108Dovecot v2.3 2015-05-09 DOVEADM-BATCH(1)