HEX
Server: Apache/2
System: Linux nexus-01 4.18.0-553.120.1.el8_10.x86_64 #1 SMP Mon Apr 20 18:04:27 EDT 2026 x86_64
User: aglcoke (1118)
PHP: 8.2.31
Disabled: mail,exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/share/man/man1/doveadm-import.1
.TH "DOVEADM-IMPORT" "1" "May 2026" "e5ac02a" "Dovecot"
.SH "NAME"
\fBdoveadm-import\fR - Import messages matching given search query
.SH "SYNOPSIS"
.P
\fBdoveadm\fR \[lB]\fIGLOBAL OPTIONS\fR\[rB] \fBimport\fR \[lB]\fB-S\fR \fIsocket_path\fR\[rB] \[lB]\fB-U\fR \fIsource_user\fR\[rB] \[lB]\fB-s\fR\[rB] \fB-A\fR \fIsource_mail_driver\fR:\fIsource_mail_path\fR
.P
\fBdoveadm\fR \[lB]\fIGLOBAL OPTIONS\fR\[rB] \fBimport\fR \[lB]\fB-S\fR \fIsocket_path\fR\[rB] \[lB]\fB-U\fR \fIsource_user\fR\[rB] \[lB]\fB-s\fR\[rB] \fB-F\fR \fIfile\fR \fIsource_mail_driver\fR:\fIsource_mail_path\fR
.P
\fBdoveadm\fR \[lB]\fIGLOBAL OPTIONS\fR\[rB] \fBimport\fR \[lB]\fB-S\fR \fIsocket_path\fR\[rB] \[lB]\fB-U\fR \fIsource_user\fR\[rB] \[lB]\fB-s\fR\[rB] \fB-u\fR \fIuser\fR \fIsource_mail_driver\fR:\fIsource_mail_path\fR
.SH "DESCRIPTION"
.P
This command can be used to import mails from another mail storage specified by \fIsource_mail_driver\fR, \fIsource_mail_path\fR, and other settings specified via \fB-p\fR parameters to one or more user's mailboxes. 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. By default the import is done in destination user's context, you can use -U to change this.
.P
In the first form, the mails will be imported for all users.
.P
In the second form, the mails will be imported for all users listed in the given \fIfile\fR.
.P
In the final form, the mails will be imported only for given \fIuser\fR (s).
.SH "GLOBAL OPTIONS"
.P
Global doveadm(1) \fIoptions\fR:
.P
\fB-D\fR
.RS 0
.RS 4
.P
Enables \fIverbosity\fR and debug messages.
.RE 0

.RE 0

.P
\fB-O\fR
.RS 0
.RS 4
.P
Do not read any config file, just use defaults. The \fBdovecot_storage_version\fR setting defaults to the latest version, but can be overridden with \fB-o\fR.
.RE 0

.RE 0

.P
\fB-k\fR
.RS 0
.RS 4
.P
Preserve entire environment for doveadm, not just \fBimport_environment\fR setting.
.RE 0

.RE 0

.P
\fB-v\fR
.RS 0
.RS 4
.P
Enables verbosity, including progress counter.
.RE 0

.RE 0

.P
\fB-i\fR \fIinstance-name\fR
.RS 0
.RS 4
.P
If using multiple Dovecot instances, choose the config file based on this instance name.
.P
See \fBinstance_name\fR setting for more information.
.RE 0

.RE 0

.P
\fB-c\fR \fIconfig-file\fR
.RS 0
.RS 4
.P
Read configuration from the given \fIconfig-file\fR. By default it first reads config socket, and then falls back to \fI/etc/dovecot/dovecot.conf\fR. You can also point this to config socket of some instance running compatible version.
.RE 0

.RE 0

.P
\fB-o\fR \fIsetting\fR\fB=\fR\fIvalue\fR
.RS 0
.RS 4
.P
Overrides the configuration \fIsetting\fR from \fI/etc/dovecot/dovecot.conf\fR and from the userdb with the given \fIvalue\fR. In order to override multiple settings, the \fB-o\fR option may be specified multiple times.
.RE 0

.RE 0

.SH "OPTIONS"
.P
\fB-A\fR
.RS 0
.RS 4
.P
If the \fB-A\fR option is present, the \fIcommand\fR will be performed for all users. Using this option in combination with system users from \fBuserdb { driver = passwd }\fR is not recommended, because it contains also users with a lower UID than the one configured with the \fBfirst_valid_uid\fR setting.
.P
When the SQL userdb module is used, make sure that the \fBuserdb_sql_iterate_query\fR setting setting matches your database layout.
.P
When using the LDAP userdb module, make sure that the \fBuserdb_fields\fR setting and \fBuserdb_ldap_iterate_fields\fR setting settings match your LDAP schema. Otherwise doveadm(1) will be unable to iterate over all users.
.RE 0

.RE 0

.P
\fB-F\fR \fIfile\fR
.RS 0
.RS 4
.P
Execute the \fIcommand\fR for all the users in the \fIfile\fR. This is similar to the \fB-A\fR option, but instead of getting the list of users from the userdb, they are read from the given \fIfile\fR. The \fIfile\fR contains one username per line.
.RE 0

.RE 0

.P
\fB--no-userdb-lookup\fR
.RS 0
.RS 4
.P
Do not perform userdb lookup. Use the \fBUSER\fR environment variable to specify the username.
.RE 0

.RE 0

.P
\fB-S\fR \fIsocket_path\fR
.RS 0
.RS 4
.P
The option's argument is either an absolute path to a local UNIX domain socket, or a hostname and port (\fIhostname\fR:\fIport\fR), in order to connect a remote host via a TCP socket.
.P
This allows an administrator to execute doveadm(1) mail commands through the given socket.
.RE 0

.RE 0

.P
\fB-p\fR \fIsetting\fR\fB=\fR\fIvalue\fR
.RS 0
.RS 4
.P
Overrides the configuration \fIsetting\fR for source storage.
.RE 0

.RE 0

.P
\fB-s\fR
.RS 0
.RS 4
.P
When the \fB-s\fR option is present, \fIdest_parent\fR and all new mailboxes under it will be subscribed to.
.RE 0

.RE 0

.P
\fB-U username\fR
.RS 0
.RS 4
.P
When the \fB-U\fR option is present, the source box is opened with given username.
.RE 0

.RE 0

.P
\fB-u\fR \fIuser/mask\fR
.RS 0
.RS 4
.P
Run the \fIcommand\fR only for the given \fIuser\fR. It's also possible to use '\fB*\fR' and '\fB?\fR' wildcards (e.g. -u *@example.org).
.RE 0

.RE 0

.SH "ARGUMENTS"
.P
\fIdest_parent\fR
.RS 0
.RS 4
.P
The name of the destination mailbox, under which the mails should be imported. doveadm(1) will create the \fIdest_parent\fR mailbox if it doesn't exist.
.RE 0

.RE 0

.P
\fIsearch_query\fR
.RS 0
.RS 4
.P
Copy messages matching this search query. See doveadm-search-query(7) for details.
.RE 0

.RE 0

.P
\fIsource_mail_driver\fR:\fIsource_mail_path\fR
.RS 0
.RS 4
.P
This argument specifies the \fImail_driver\fR and \fImail_path\fR settings for the source location. The \fB-p\fR parameter can optionally be used to specify additional settings. For example: \fBmaildir:/backup/20101126/jane.doe/Maildir\fR or \fB-p mail_alt_path=/nfsmount/john.doe/mdbox mdbox:/srv/mail/john.doe/mdbox\fR
.RE 0

.RE 0

.SH "EXAMPLE"
.P
This example imports all mails from a backup under a \fIbackup-20101026\fR mailbox:
.P
.RS 2
.nf
doveadm import -u jane.doe@example.org \[rs]
  mdbox:/backup/20101026/jane.doe/mdbox backup-20101026 all
.fi
.RE
.P
Another example that imports only messages from \fI\(lafoo@example.org\(ra\fR in the backup mdbox's INBOX to jane's INBOX:
.P
.RS 2
.nf
doveadm import -u jane.doe@example.org \[rs]
  mdbox:~/mdbox-backup "" mailbox INBOX from foo@example.org
.fi
.RE
.SH "REPORTING BUGS"
.P
Report bugs, including \fIdoveconf -n\fR output, to the Dovecot Mailing List \fI\(ladovecot@dovecot.org\(ra\fR. Information about reporting bugs is available at: \fI\(lahttps://dovecot.org/bugreport.html\(ra\fR
.SH "SEE ALSO"
.P
doveadm(1), doveadm-search-query(7)