.\" Copyright (c) 2010-2013 Dovecot authors, see the included COPYING file .TH DOVEADM\-IMPORT 1M "2013-11-24" "Dovecot v2.2" "Dovecot" .SH NAME doveadm import \- Import messages matching given search query .\"------------------------------------------------------------------------ .SH SYNOPSIS .nh .na .HP \" ./global-options-short.inc \" ./master-options-short.inc \" ./mail-options-short.inc \fBdoveadm import\fR [\-D] [\-F\ \fIformatter\fR] [\-v] [\-c\ \fIfile\fR|\-i\ \fIinstance\fR] [\-k] [\-L] [\-O] [\-o\ \fIsetting\fB=\fIvalue\fR]... [\-S\ \fIsocket\fR] [\-A|\-u\ \fIuser\fR] [\-s] \fIsource_location dest_parent search_query\fR .ad .hy .\"------------------------------------------------------------------------ .SH DESCRIPTION This command can be used to import mails from another mail storage specified by \fIsource_location\fR to its own or other user\'s mailboxes (see option \fB-A\fR or \fB\-u\ \fIuser\fR). All the mailboxes are imported under the given \fIdest_parent\fR mailbox, or to root level if \fIdest_parent\fR is empty (""). The \fIsearch_query\fR can be used to restrict which mailboxes or messages are imported. .\"------------------------------------------------------------------------ .SH OPTIONS Common options: \" ./global-options.inc \" vim: ts=4 sw=4 filetype=nroff .TP .B \-D Enables verbosity and debug messages. .TP .BI \-F\ formatter Specifies the \fIformatter\fR for formatting the output. Supported formatters are: .RS .TP 2 .B flow Prints each line with .IB key = value pairs. .TP .B pager Prints each .IB key = value pair on its own line and separates records with form feed character (\fB^L\fR). .TP .B tab Prints a table header followed by tab separated value lines. .TP .B table Prints a table header followed by adjusted value lines. .RE .TP .B \-v Enables verbosity, including progress counter. \" ./master-options.inc \" vim: ts=4 sw=4 filetype=nroff .TP .BI \-c\ file Read configuration from the given \fIfile\fR. By default \fI/etc/dovecot/dovecot.conf\fR will be used. .TP .BI \-i\ instance Get the configuration from the instance with the name \fIinstance\fR. .TP .B \-k Keep environment, i.e. when executing a new process do not explicitly set the environment variables HOME, USER and when reading configurations, don\'t overwrite currently set environment variables with corresponding settings. Usually used internally, only. .TP .B \-L Log directly. .TP .B \-O Don\'t read settings, but use whatever is in the environment. .TP .BI \-o\ setting = value Overrides the \fIsetting\fR from the current configuration with the given \fIvalue\fR (can be specified multiple times). E.g. with \-o dsync_alt_char=c one is able to overwrite the character to use as an replacement for all invalid characters encountered within a mailbox name (per default \'\fB_\fR'). \" ./mail-options.inc \" vim: ts=4 sw=4 filetype=nroff .TP .BI \-S\ socket The option\'s argument \fIsocket\fR is either an absolute path to a local UNIX domain socket, or a \fIhostname\fB:\fIport\fR pair, in order to connect a remote host via a TCP socket. This allows an administrator to execute .BR doveadm (1M) mail commands through the given socket. .TP .B \-A Run this command for \fBall\fR users. Using this option in combination with system users from .B userdb { driver = passwd } is not recommended, because it contains also users with a lower UID than the one configured with the \fIfirst_valid_uid\fR setting. When the SQL userdb module is used make sure that the \fIiterate_query\fR setting in .I /etc/dovecot/conf.d/sql.conf matches your database layout. When using the LDAP userdb module, make sure that the \fIiterate_attrs\fR and \fIiterate_filter\fR settings in .I /etc/dovecot/conf.d/ldap.conf match your LDAP schema. Otherwise .BR doveadm (1M) will be unable to iterate over \fBall\fR users. .TP .BI \-u\ user Run this command for the specified \fIuser\fR, only. It is also possible to use \'\fB*\fR\' and \'\fB?\fR\' wildcards (e.g. \-u \e*@example.org). When neither the \fB\-A\fR nor \fB\-u\ \fIuser\fR option was specified, this command will be executed with the environment of the currently logged in user, i.e. dovecot will use the value of the environment variable \fBUSER\fR as user name. If it is unset, the command fails. .P Command specific options: .\"------------------------------------- .TP .B \-s When this option is present, \fIdest_parent\fR and all new mailboxes under it will be listed in the \fIsubscriptions\fR file. .\"------------------------------------------------------------------------ .SH OPERANDS .TP .I source_location Specifies the mailbox format and location of the source location. The syntax is the same as for the \fImail_location\fR setting. For example: .B maildir:/backup/20101126/jane.doe/Maildir or .B mdbox:/srv/mail/john.doe/mdbox:ALT=/nfsmount/john.doe/mdbox .TP .I dest_parent The name of the destination mailbox, under which the mails should be imported. .BR doveadm (1M) will create the \fIdest_parent\fR mailbox if it doesn\'t exist. .TP .I search_query Copy messages matching this search query. See .BR doveadm\-search\-query (5) for details. .\"------------------------------------------------------------------------ .SH EXAMPLES .nh This example imports all mails from a backup under a backup\-20101026 mailbox: .hy .RS 3 .nf \fBdoveadm import \-u jane.doe@example.org \e mdbox:/backup/20101026/jane.doe/mdbox backup\-20101026 all\fR .fi .RE Another example that imports only messages from foo@example.org in the backup mdbox\'s INBOX to jane\'s INBOX: .RS 3 .nf \fBdoveadm import \-u jane.doe@example.org \e mdbox:~/mdbox\-backup "" mailbox INBOX from foo@example.org\fR .fi .RE .\"------------------------------------------------------------------------ .SH SEE ALSO .BR doveadm (1M), .BR doveadm\-fetch (1M), .BR doveadm\-search (1M), .BR doveadm\-search\-query (5) .\"------------------------------------------------------------------------ \" ./reporting-bugs.inc .SH REPORTING BUGS Report bugs, including \fBdoveconf \-n\fR output, to the dovecot Mailing List . Information about reporting bugs is available at: http://dovecot.org/bugreport.html