1DOVEADM-SEARCH(1) Dovecot DOVEADM-SEARCH(1)
2
3
4
6 doveadm-search - Show a list of mailbox GUIDs and message UIDs matching
7 given search query.
8
10 doveadm [-Dv] [-f formatter] search [-S socket_path] search_query
11 doveadm [-Dv] [-f formatter] search [-S socket_path] -A search_query
12 doveadm [-Dv] [-f formatter] search [-S socket_path] -u user
13 search_query
14
16 The search command is used to find matching messages. doveadm(1) will
17 print the mailbox's guid and the message's uid for each match.
18 When used with the -A or -u wildcard options, doveadm(1) will print the
19 fields username, mailbox-guid and uid for each matching message.
20
21 In the first form, doveadm(1) will executed the search action with the
22 environment of the logged in system user.
23
24 In the second form, the command will be performed for all users.
25
26 In the third form, only matching mails of the given user(s) will be
27 searched.
28
30 Global doveadm(1) options:
31
32 -D Enables verbosity and debug messages.
33
34 -f formatter
35 Specifies the formatter for formatting the output. Supported
36 formatters are:
37
38 flow prints each line with key=value pairs.
39
40 pager prints each key: value pair on its own line and separates
41 records with form feed character (^L).
42
43 tab prints a table header followed by tab separated value
44 lines.
45
46 table prints a table header followed by adjusted value lines.
47
48 -v Enables verbosity, including progress counter.
49
50 This command uses by default the output formatter flow (without the
51 key= prefix).
52
53 Command specific options:
54
55 -A If the -A option is present, the command will be performed for
56 all users. Using this option in combination with system users
57 from userdb { driver = passwd } is not recommended, because it
58 contains also users with a lower UID than the one configured
59 with the first_valid_uid setting.
60
61 When the SQL userdb module is used make sure that the iter‐
62 ate_query setting in /etc/dovecot/dovecot-sql.conf.ext matches
63 your database layout. When using the LDAP userdb module, make
64 sure that the iterate_attrs and iterate_filter settings in
65 /etc/dovecot/dovecot-ldap.conf.ext match your LDAP schema. Oth‐
66 erwise doveadm(1) will be unable to iterate over all users.
67
68 -S socket_path
69 The option's argument is either an absolute path to a local UNIX
70 domain socket, or a hostname and port (hostname:port), in order
71 to connect a remote host via a TCP socket.
72
73 This allows an administrator to execute doveadm(1) mail commands
74 through the given socket.
75
76 -u user/mask
77 Run the command only for the given user. It's also possible to
78 use '*' and '?' wildcards (e.g. -u *@example.org).
79 When neither the -A option nor -u user was specified, the com‐
80 mand will be executed with the environment of the currently
81 logged in user.
82
84 search_query
85 Show messages matching this search query. See
86 doveadm-search-query(7) for details.
87
89 This example demonstrates how to search in user bob's dovecot mailboxes
90 all messages, which contains the word "todo" in the Subject: header.
91
92 doveadm search -u bob mailbox dovecot\* subject todo
93 3a94c928d66ebe4bda04000015811c6a 8
94 3a94c928d66ebe4bda04000015811c6a 25
95 3a94c928d66ebe4bda04000015811c6a 45
96
97 The search command is mainly useful when used together with
98 doveadm fetch command. For example to save message bodies of all mes‐
99 sages from INBOX that have "todo" in subject, use:
100
101 doveadm search -u bob mailbox INBOX subject todo |
102 while read guid uid; do
103 doveadm fetch -u bob body mailbox-guid $guid uid $uid > msg.$uid
104 done
105
107 Report bugs, including doveconf -n output, to the Dovecot Mailing List
108 <dovecot@dovecot.org>. Information about reporting bugs is available
109 at: http://dovecot.org/bugreport.html
110
112 doveadm(1), doveadm-fetch(1), doveadm-search-query(7)
113
114
115
116Dovecot v2.0 2010-11-25 DOVEADM-SEARCH(1)