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

NAME

6       doveadm-move  -  Move  messages  matching  the  given search query into
7       another mailbox
8       doveadm-copy - Copy messages  matching  the  given  search  query  into
9       another mailbox
10

SYNOPSIS

12       doveadm  [-Dv]  move  [-S  socket_path]  destination [user source_user]
13       search_query
14       doveadm [-Dv] move [-S socket_path] -A destination  [user  source_user]
15       search_query
16       doveadm   [-Dv]   move  [-S  socket_path]  -F  file  destination  [user
17       source_user] search_query
18       doveadm  [-Dv]  move  [-S  socket_path]  -u  user   destination   [user
19       source_user] search_query
20
21       doveadm  [-Dv]  copy  [-S  socket_path]  destination [user source_user]
22       search_query
23       doveadm [-Dv] copy [-S socket_path] -A destination  [user  source_user]
24       search_query
25       doveadm   [-Dv]   copy  [-S  socket_path]  -F  file  destination  [user
26       source_user] search_query
27       doveadm  [-Dv]  copy  [-S  socket_path]  -u  user   destination   [user
28       source_user] search_query
29

DESCRIPTION

31       doveadm  move can be used for moving mails between mailboxes for one or
32       more users.  The search_query is used to restrict  which  messages  are
33       moved into the destination mailbox.
34       doveadm  copy behaves the same as doveadm move, except that copied mes‐
35       sages will not be expunged after copying.
36
37       In the first form, doveadm(1) will execute the  move/copy  action  with
38       the environment of the logged in system user.
39
40       In  the  second  form, doveadm(1) will iterate over all users, found in
41       the configured user_db(s), and  move  or  copy  each  user's  messages,
42       matching the given search_query, into the user's destination mailbox.
43
44       In the third form, doveadm(1) will iterate over all users, found in the
45       given file, and move or copy each user's messages, matching  the  given
46       search_query, into the user's destination mailbox.
47
48       In  the  fourth  form,  matching mails will be moved or copied only for
49       given user(s).
50

OPTIONS

52       Global doveadm(1) options:
53
54       -D     Enables verbosity and debug messages.
55
56       -o setting=value
57              Overrides  the  configuration  setting  from  /etc/dovecot/dove‐
58              cot.conf  and from the userdb with the given value.  In order to
59              override multiple settings, the -o option may be specified  mul‐
60              tiple times.
61
62       -v     Enables verbosity, including progress counter.
63
64       Command specific options:
65
66       -A     If  the  -A option is present, the command will be performed for
67              all users.  Using this option in combination with  system  users
68              from  userdb  { driver = passwd } is not recommended, because it
69              contains also users with a lower UID  than  the  one  configured
70              with the first_valid_uid setting.
71
72              When  the  SQL  userdb  module  is used make sure that the iter‐
73              ate_query setting in  /etc/dovecot/dovecot-sql.conf.ext  matches
74              your  database  layout.  When using the LDAP userdb module, make
75              sure that  the  iterate_attrs  and  iterate_filter  settings  in
76              /etc/dovecot/dovecot-ldap.conf.ext match your LDAP schema.  Oth‐
77              erwise doveadm(1) will be unable to iterate over all users.
78
79       -F file
80              Execute the command for all the users in the file.  This is sim‐
81              ilar  to the -A option, but instead of getting the list of users
82              from the userdb, they are read from the given  file.   The  file
83              contains one username per line.
84
85       -S socket_path
86              The option's argument is either an absolute path to a local UNIX
87              domain socket, or a hostname and port (hostname:port), in  order
88              to connect a remote host via a TCP socket.
89
90              This allows an administrator to execute doveadm(1) mail commands
91              through the given socket.
92
93       -u user/mask
94              Run the command only for the given user.  It's also possible  to
95              use '*' and '?' wildcards (e.g. -u *@example.org).
96              When  neither  the  -A  option,  nor the -F file option, nor the
97              -u user was specified, the command will  be  executed  with  the
98              environment of the currently logged in user.
99

ARGUMENTS

101       destination
102              The name of the destination mailbox, into which the mails should
103              be moved or copied.  The destination mailbox must exist,  other‐
104              wise this command will fail.
105
106       search_query
107              Move/copy   messages  matching  the  given  search  query.   See
108              doveadm-search-query(7) for details.
109
110       user source_user
111              The keyword user followed by a valid user name.  When this argu‐
112              ment  is  present, doveadm(1) will apply the search_query to the
113              source_user's mail_location.
114              Limitation: Currently the users, specified by -u user  and  user
115              source_user, must share the same UID and GID.
116

EXAMPLE

118       Move jane's messages - received in September 2011 - from her INBOX into
119       her archive.
120
121       doveadm move -u jane Archive/2011/09 mailbox INBOX BEFORE \
122       2011-10-01 SINCE 01-Sep-2011
123

REPORTING BUGS

125       Report bugs, including doveconf -n output, to the Dovecot Mailing  List
126       <dovecot@dovecot.org>.   Information  about reporting bugs is available
127       at: http://dovecot.org/bugreport.html
128

SEE ALSO

130       doveadm(1), doveadm-search-query(7)
131
132
133
134Dovecot v2.3                      2015-05-09                   DOVEADM-MOVE(1)
Impressum