1DOVEADM-IMPORT(1) Dovecot DOVEADM-IMPORT(1)
2
3
4
6 doveadm-import - Import messages matching given search query
7
9 doveadm [-Dv] import [-S socket_path] [-U source_user] [-s]
10 source_location dest_parent search_query
11 doveadm [-Dv] import [-S socket_path] [-U source_user] [-s] -A
12 source_location dest_parent search_query
13 doveadm [-Dv] import [-S socket_path] [-s] -F file source_location
14 dest_parent search_query
15 doveadm [-Dv] import [-S socket_path] [-U source_user] [-s] -u user
16 source_location dest_parent search_query
17
19 This command can be used to import mails from another mail storage
20 specified by source_location to one or more user's mailboxes. All the
21 mailboxes are imported under the given dest_parent mailbox, or to root
22 level if dest_parent is empty (""). The search_query can be used to
23 restrict which mailboxes or messages are imported. By default the
24 import is done in destination user's context, you can use -U to change
25 this.
26
27 In the first form, doveadm(1) will executed the import action with the
28 environment of the logged in system user.
29
30 In the second form, the mails will be imported for all users.
31
32 In the third form, the mails will be imported for all users listed in
33 the given file.
34
35 In the fourth form, the mails will be imported only for given user(s).
36
38 Global doveadm(1) options:
39
40 -D Enables verbosity and debug messages.
41
42 -o setting=value
43 Overrides the configuration setting from /etc/dovecot/dove‐
44 cot.conf and from the userdb with the given value. In order to
45 override multiple settings, the -o option may be specified mul‐
46 tiple times.
47
48 -v Enables verbosity, including progress counter.
49
50 Command specific options:
51
52 -A If the -A option is present, the command will be performed for
53 all users. Using this option in combination with system users
54 from userdb { driver = passwd } is not recommended, because it
55 contains also users with a lower UID than the one configured
56 with the first_valid_uid setting.
57
58 When the SQL userdb module is used make sure that the iter‐
59 ate_query setting in /etc/dovecot/dovecot-sql.conf.ext matches
60 your database layout. When using the LDAP userdb module, make
61 sure that the iterate_attrs and iterate_filter settings in
62 /etc/dovecot/dovecot-ldap.conf.ext match your LDAP schema. Oth‐
63 erwise doveadm(1) will be unable to iterate over all users.
64
65 -F file
66 Execute the command for all the users in the file. This is sim‐
67 ilar to the -A option, but instead of getting the list of users
68 from the userdb, they are read from the given file. The file
69 contains one username per line.
70
71 -S socket_path
72 The option's argument is either an absolute path to a local UNIX
73 domain socket, or a hostname and port (hostname:port), in order
74 to connect a remote host via a TCP socket.
75
76 This allows an administrator to execute doveadm(1) mail commands
77 through the given socket.
78
79 -s When the -s option is present, dest_parent and all new mailboxes
80 under it will be subscribed to.
81
82 -u user/mask
83 Run the command only for the given user. It's also possible to
84 use '*' and '?' wildcards (e.g. -u *@example.org).
85 When neither the -A option, nor the -F file option, nor the
86 -u user was specified, the command will be executed with the
87 environment of the currently logged in user.
88
89 -U username
90 When the -U option is present, the source box is opened with
91 given username.
92
94 dest_parent
95 The name of the destination mailbox, under which the mails
96 should be imported. doveadm(1) will create the dest_parent
97 mailbox if it doesn't exist.
98
99 search_query
100 Copy messages matching this search query. See
101 doveadm-search-query(7) for details.
102
103 source_location
104 This argument specifies the mailbox format and location of the
105 source location. The syntax is the same as for the mail_location
106 setting. For example: maildir:/backup/20101126/jane.doe/Maildir
107 or mdbox:/srv/mail/john.doe/mdbox:ALT=/nfsmount/john.doe/mdbox
108
110 This example imports all mails from a backup under a backup-20101026
111 mailbox:
112
113 doveadm import -u jane.doe@example.org \
114 mdbox:/backup/20101026/jane.doe/mdbox backup-20101026 all
115
116 Another example that imports only messages from foo@example.org in the
117 backup mdbox's INBOX to jane's INBOX:
118
119 doveadm import -u jane.doe@example.org \
120 mdbox:~/mdbox-backup "" mailbox INBOX from foo@example.org
121
123 Report bugs, including doveconf -n output, to the Dovecot Mailing List
124 <dovecot@dovecot.org>. Information about reporting bugs is available
125 at: http://dovecot.org/bugreport.html
126
128 doveadm(1), doveadm-fetch(1), doveadm-search(1),
129 doveadm-search-query(7)
130
131
132
133Dovecot v2.2 2015-08-09 DOVEADM-IMPORT(1)