DOVEADM-IMPORT(1)
π DOVEADM-IMPORT(1) β the Dovecot manual, but make it make sense
okay bestie, sit down, hydrate, because we're about to import so many mails. this is doveadm-import, part of the Dovecot fam (manual section 1, obvs). it's giving "moving your whole life into a new mailbox" energy and honestly? iconic. π¦
β¨ SYNOPSIS β¨
the three forms, verbatim, no notes:
doveadm [GLOBAL OPTIONS] import [-S socket_path] [-U source_user] [-s]
-A source_mail_driver:source_mail_path
doveadm [GLOBAL OPTIONS] import [-S socket_path] [-U source_user] [-s]
-F file source_mail_driver:source_mail_path
doveadm [GLOBAL OPTIONS] import [-S socket_path] [-U source_user] [-s]
-u user source_mail_driver:source_mail_path
πΈ DESCRIPTION πΈ
so here's the tea: this command pulls mails in from another mail storage β one you describe with source_mail_driver, source_mail_path, and any extra settings you pass along via -p β and drops them into one or more users' mailboxes. lowkey magical. β¨
every mailbox that comes over lands under the dest_parent mailbox you name. if dest_parent is empty (""), they land at root level instead. and search_query? that's your little filter, it decides which mailboxes or messages actually get imported. by default the whole import happens in the destination user's context β if you wanna switch that up, that's what -U is for. π
now the three forms, one by one:
- form one β mails get imported for all users. everybody. the whole group chat.
- form two β mails get imported for all users listed in the given file.
- form three β mails get imported only for the given user(s). just them. main character.
π GLOBAL OPTIONS π
these are the global doveadm(1) options, shared with the rest of the crew:
-Dβ turns on verbosity and debug messages. the "tell me everything" setting. π£οΈ-Oβ don't read any config file, just use defaults. thedovecot_storage_versionsetting defaults to the latest version, but you can override it with-oif you're feeling spicy.-kβ preserves the entire environment fordoveadm, not just theimport_environmentsetting. full vibe retention. π«Ά-vβ enables verbosity, progress counter included. watch that number go up, so satisfying.-i instance-nameβ if you're running multiple Dovecot instances, pick which config file to use based on this instance name.
see the instance_name setting for more info.
-c config-fileβ read config from the given config-file. by default it reads the config socket first, then falls back to/etc/dovecot/dovecot.conf. you can also point this at the config socket of some instance running a compatible version. compatibility slay. π-o setting=valueβ overrides a config setting from/etc/dovecot/dovecot.confand from the userdb with the given value. wanna override multiple settings? just pass-omultiple times, she's flexible. π
π OPTIONS π
-Aβ if present, the command runs for all users. but listen: combining this with system users fromuserdb { driver = passwd }is not recommended, because that userdb also contains users with a lower UID than the one configured with thefirst_valid_uidsetting. mess.
if you're using the SQL userdb module, double-check that the userdb_sql_iterate_query setting setting matches your database layout. yes, "setting setting." it's in the original, don't @ me. π
and if you're on the LDAP userdb module, make sure the userdb_fields setting and userdb_ldap_iterate_fields setting settings match your LDAP schema. otherwise doveadm(1) will be unable to iterate over all users. no cap, that's a real blocker. π
-F fileβ run the command for all the users in file. it's like-A's cooler cousin, except instead of pulling the user list from the userdb, it reads them from the given file. the file contains one username per line. clean, simple, organized. π--no-userdb-lookupβ skip the userdb lookup entirely. use theUSERenvironment variable to specify the username. DIY era. β¨-S socket_pathβ the argument is either an absolute path to a local UNIX domain socket, or a hostname and port (hostname:port) so you can connect to a remote host over a TCP socket.
this lets an administrator execute doveadm(1) mail commands through the given socket. remote control, but make it mail. π₯
-p setting=valueβ overrides the configuration setting for the source storage. (source! not dest! pay attention bestie.)-sβ when present,dest_parentand all new mailboxes under it get subscribed to. subscribe, bell icon, all of it. π-U usernameβ when present, the source box is opened with the given username. this is the context switcher I mentioned earlier. π-u user/maskβ run the command only for the given user. you can also use*and?wildcards (e.g.-u *@example.org). wildcards are so underrated fr fr.
π§ ARGUMENTS π§
dest_parentβ the name of the destination mailbox, the one the mails get imported under.doveadm(1)will create thedest_parentmailbox if it doesn't exist yet. it's got you. π«Άsearch_queryβ copy messages matching this search query. seedoveadm-search-query(7)for the details, that's where the full menu lives.source_mail_driver:source_mail_pathβ this argument specifies themail_driverandmail_pathsettings for the source location. the-pparameter can optionally be used to specify additional settings. for example:maildir:/backup/20101126/jane.doe/Maildiror-p mail_alt_path=/nfsmount/john.doe/mdbox mdbox:/srv/mail/john.doe/mdbox. see how the-psneaks in there? that's the pattern. β¨
π EXAMPLE π
example one! this imports all mails from a backup under a backup-20101026 mailbox:
doveadm import -u jane.doe@example.org \
mdbox:/backup/20101026/jane.doe/mdbox backup-20101026 all
example two! this one imports only messages from β¨foo@example.orgβ© in the backup mdbox's INBOX into jane's INBOX:
doveadm import -u jane.doe@example.org \
mdbox:~/mdbox-backup "" mailbox INBOX from foo@example.org
notice the ""? that's the empty dest_parent β root level, no nesting. she said "put it right at the top." π
π REPORTING BUGS π
found a bug? report it β and please include your doveconf -n output β to the Dovecot Mailing List β¨dovecot@dovecot.orgβ©. info about reporting bugs lives at: β¨https://dovecot.org/bugreport.htmlβ©
do it properly, we love a thorough bug report. π«Ά
π SEE ALSO π
doveadm(1), doveadm-search-query(7)
and that's the whole page, bestie. this version is from source/version f979264, dated April 2026 π stay hydrated, back up your maildirs, and go import something. periodt. ππ
π¦ where this page comes from
- alpine 3.23: dovecot-doc 2.4.5-r0 Β· MIT AND LGPL-2.1-or-later
- alpine 3.24: dovecot-doc 2.4.5-r0 Β· MIT AND LGPL-2.1-or-later
- arch rolling: dovecot 2.4.5-1 Β· MIT AND LGPL-2.1-only
- fedora 43: dovecot 1:2.4.5-1.fc43 Β· MIT AND LGPL-2.1-only
- fedora 44: dovecot 1:2.4.5-1.fc44 Β· MIT AND LGPL-2.1-only
- nixos 26.05: dovecot 2.4.5
- nixpkgs unstable: dovecot 2.4.5
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- opensuse-leap 16.0: dovecot24 2.4.5-160000.1.1 Β· BSD-3-Clause AND LGPL-2.1-or-later AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms