1DOVEADM-EXPUNGE(1) Dovecot DOVEADM-EXPUNGE(1)
2
3
4
6 doveadm-expunge - Expunge messages matching given search query
7
9 doveadm [-Dv] expunge [-S socket_path] search_query
10 doveadm [-Dv] expunge [-S socket_path] -A search_query
11 doveadm [-Dv] expunge [-S socket_path] -u user search_query
12
14 This command can be used to expunge mails matching the given search
15 query. It is typically used to expunge old mails from users' Trash
16 and/or Spam mailboxes. To test which messages a given search query
17 would match, you can use doveadm fetch or doveadm search commands.
18
19 In the first form, doveadm(1) will executed the expunge action with the
20 environment of the logged in system user.
21
22 In the second form, the command will be performed for all users.
23
24 In the third form, only matching mails of the given user(s) will be
25 expunged.
26
28 Global doveadm(1) options:
29
30 -D Enables verbosity and debug messages.
31
32 -v Enables verbosity, including progress counter.
33
34 Command specific options:
35
36 -A If the -A option is present, the command will be performed for
37 all users. Using this option in combination with system users
38 from userdb { driver = passwd } is not recommended, because it
39 contains also users with a lower UID than the one configured
40 with the first_valid_uid setting.
41
42 When the SQL userdb module is used make sure that the iter‐
43 ate_query setting in /etc/dovecot/dovecot-sql.conf.ext matches
44 your database layout. When using the LDAP userdb module, make
45 sure that the iterate_attrs and iterate_filter settings in
46 /etc/dovecot/dovecot-ldap.conf.ext match your LDAP schema. Oth‐
47 erwise doveadm(1) will be unable to iterate over all users.
48
49 -S socket_path
50 The option's argument is either an absolute path to a local UNIX
51 domain socket, or a hostname and port (hostname:port), in order
52 to connect a remote host via a TCP socket.
53
54 This allows an administrator to execute doveadm(1) mail commands
55 through the given socket.
56
57 -u user/mask
58 Run the command only for the given user. It's also possible to
59 use '*' and '?' wildcards (e.g. -u *@example.org).
60 When neither the -A option nor -u user was specified, the com‐
61 mand will be executed with the environment of the currently
62 logged in user.
63
65 search_query
66 Expunge messages matching this search query. See
67 doveadm-search-query(7) for details.
68
70 This example expunges messages from Spam mailbox that were saved/copied
71 there more than two weeks ago:
72
73 doveadm expunge -u jane.doe@example.org mailbox Spam savedbefore 2w
74
76 Report bugs, including doveconf -n output, to the Dovecot Mailing List
77 <dovecot@dovecot.org>. Information about reporting bugs is available
78 at: http://dovecot.org/bugreport.html
79
81 doveadm(1), doveadm-fetch(1), doveadm-purge(1), doveadm-search(1),
82 doveadm-search-query(7)
83
84
85
86Dovecot v2.0 2010-11-25 DOVEADM-EXPUNGE(1)