1DOVEADM-FETCH(1)                    Dovecot                   DOVEADM-FETCH(1)
2
3
4

NAME

6       doveadm-fetch - Fetch partial/full messages or message information
7

SYNOPSIS

9       doveadm [-Dv] [-f formatter] fetch [-S socket_path] fields search_query
10       doveadm   [-Dv]   [-f  formatter]  fetch  [-S  socket_path]  -A  fields
11       search_query
12       doveadm [-Dv] [-f formatter] fetch  [-S  socket_path]  -F  file  fields
13       search_query
14       doveadm  [-Dv]  [-f  formatter]  fetch  [-S socket_path] -u user fields
15       search_query
16

DESCRIPTION

18       doveadm fetch can be used to fetch  messages'  contents  and  metadata.
19       This  can be useful for scripts and for debugging. If you want to fetch
20       messages one at a time, see doveadm-search(1).
21
22       Important:
23              Please respect your users' privacy.
24

OPTIONS

26       Global doveadm(1) options:
27
28       -D     Enables verbosity and debug messages.
29
30       -f formatter
31              Specifies the formatter for formatting  the  output.   Supported
32              formatters are:
33
34              flow   prints each line with key=value pairs.
35
36              pager  prints each key: value pair on its own line and separates
37                     records with form feed character (^L).
38
39              tab    prints a table header followed  by  tab  separated  value
40                     lines.
41
42              table  prints a table header followed by adjusted value lines.
43
44       -o setting=value
45              Overrides  the  configuration  setting  from  /etc/dovecot/dove‐
46              cot.conf and from the userdb with the given value.  In order  to
47              override  multiple settings, the -o option may be specified mul‐
48              tiple times.
49
50       -v     Enables verbosity, including progress counter.
51
52       This command uses by default the output formatter pager.
53
54       Command specific options:
55
56       -A     If the -A option is present, the command will be  performed  for
57              all  users.   Using this option in combination with system users
58              from userdb { driver = passwd } is not recommended,  because  it
59              contains  also  users  with  a lower UID than the one configured
60              with the first_valid_uid setting.
61
62              When the SQL userdb module is used  make  sure  that  the  iter‐
63              ate_query  setting  in /etc/dovecot/dovecot-sql.conf.ext matches
64              your database layout.  When using the LDAP userdb  module,  make
65              sure  that  the  iterate_attrs  and  iterate_filter  settings in
66              /etc/dovecot/dovecot-ldap.conf.ext match your LDAP schema.  Oth‐
67              erwise doveadm(1) will be unable to iterate over all users.
68
69       -F file
70              Execute the command for all the users in the file.  This is sim‐
71              ilar to the -A option, but instead of getting the list of  users
72              from  the  userdb,  they are read from the given file.  The file
73              contains one username per line.
74
75       -S socket_path
76              The option's argument is either an absolute path to a local UNIX
77              domain  socket, or a hostname and port (hostname:port), in order
78              to connect a remote host via a TCP socket.
79
80              This allows an administrator to execute doveadm(1) mail commands
81              through the given socket.
82
83       -u user/mask
84              Run  the command only for the given user.  It's also possible to
85              use '*' and '?' wildcards (e.g. -u *@example.org).
86              When neither the -A option, nor  the  -F file  option,  nor  the
87              -u user  was  specified,  the  command will be executed with the
88              environment of the currently logged in user.
89

ARGUMENTS

91       fields One or more result field names to display, if  the  search_query
92              matches  any  messages.   In  order  to specify multiple fields,
93              enclose them in single or double quotes.
94              Supported fields are:
95
96              body   The body of a message.
97
98              date.received
99                     Date and time of final delivery,  when  the  message  was
100                     delivered to a user's mailbox for the first time.
101                     The  internal  date  and time of the source message, when
102                     the message was copied by the IMAP COPY command.
103                     The date-time attribute when present, otherwise the  cur‐
104                     rent  time, when the message was saved by the IMAP APPEND
105                     command.
106
107              date.saved
108                     Date and time when the message was saved to mailbox.
109
110              date.sent
111                     Date and time of the message's Date: header.
112
113              flags  A message's IMAP flags, e.g. \Seen
114
115              guid   A message's globally unique identifier.
116
117              hdr    The header of the message.
118
119              imap.body
120                     IMAP BODY output of the message (see RFC 3501).
121
122              imap.bodystructure
123                     IMAP BODYSTRUCTURE output of the message (see RFC 3501).
124
125              imap.envelope
126                     IMAP ENVELOPE output of the message (see RFC 3501).
127
128              mailbox
129                     Name of the mailbox, in which the message is stored.  The
130                     name is in UTF-8.
131
132              mailbox-guid
133                     The  globally  unique identifier of the mailbox, in which
134                     the message is located.
135
136              pop3.uidl
137                     A message's unique (POP3) identifier within a mailbox.
138
139              seq    A message's sequence number in a mailbox.
140
141              size.physical
142                     A message's physical size.
143
144              size.virtual
145                     A message's virtual size, computed with CRLF line  termi‐
146                     nators.
147
148              text   The entire message (header and body).
149
150              text.utf8
151                     The entire message (header and body) — UTF-8 encoded.
152
153              uid    A message's unique (IMAP) identifier in a mailbox.
154
155              user   A message owner's login name.
156
157       search_query
158              Fetch    messages    matching    this    search    query.    See
159              doveadm-search-query(7) for details.
160

EXAMPLE

162       This example based on the first example from doveadm-search(1).  We are
163       fetching  the fields mailbox and date.sent from user bob's mailbox with
164       the guid "3a94c928d66ebe4bda04000015811c6a" for the messages  with  the
165       UIDs 8, 25 and 45.
166
167       doveadm fetch -u bob "mailbox date.sent" \
168       mailbox-guid 3a94c928d66ebe4bda04000015811c6a uid 8,25,45
169       mailbox: dovecot/pigeonhole/2.0
170       date.sent: 2010-01-19 01:17:41 (+0100)
171       ^L
172       mailbox: dovecot/pigeonhole/2.0
173       date.sent: 2010-01-28 09:38:49 (+0100)
174       ^L
175       mailbox: dovecot/pigeonhole/2.0
176       date.sent: 2010-03-28 18:41:14 (+0200)
177       ^L
178

REPORTING BUGS

180       Report  bugs, including doveconf -n output, to the Dovecot Mailing List
181       <dovecot@dovecot.org>.  Information about reporting bugs  is  available
182       at: http://dovecot.org/bugreport.html
183

SEE ALSO

185       doveadm(1), doveadm-search(1), doveadm-search-query(7)
186
187
188
189Dovecot v2.2                      2015-05-09                  DOVEADM-FETCH(1)
Impressum