AW: how to dovecot import to folder/, not folder/INBOX

rudolf at padaru.de rudolf at padaru.de
Tue Feb 2 13:54:10 EET 2021


Hey,

yes, an doveadm move / copy should be enough

doveadm import -u gmail maildir:/tmp/batch-1234 backup all && doveadm
mailbox create -u gmail 2011 &&  doveadm copy -u gmail 2011 mailbox backup
all && doveadm copy -u gmail 2011 mailbox backup/* all

and then 
doveadm mailbox delete -u gmail backup

Mit freundlichen Grüßen
Yours sincerely 
Pascal Rudolf


-----Ursprüngliche Nachricht-----
Von: dovecot <dovecot-bounces at dovecot.org> Im Auftrag von didar
Gesendet: Dienstag, 2. Februar 2021 12:11
An: Dovecot ML <dovecot at dovecot.org>
Betreff: how to dovecot import to folder/, not folder/INBOX

Hi,

I am trying to import old Gmail mails from a maildir source into dovecot
folder.

  chowm -R vmail:vmail /tmp/batch-1234
  doveadm import -u gmail maildir:/tmp/batch-1234 2011 all

This works, but it imports the emails into "2011/INBOX" rather just into
"2011".
Since, the "gmail" user account has maildir storage itself, I rename the
"%h/.2011.INBOX" to "%h/.2011" manually and it seems to be working.

I am wondering if there is another cleaner way to do it? Maybe import into
default INBOX and use "doveadm move" instead?

Here is my passdb file: (this is a testing setup inside a VM in my laptop)

didar:{plain}e5d903c1615cdcd9c3d088ec2cb71b11927f7650::::
jamir:{plain}9ffeba7706846ed6be4e6e52bcc7afd792330874::::
chaitali:{plain}09ce7f54c7fee999a27967b741dc2e5f3950e7e8::::
rajesh:{plain}308059d2078ba123c435ebf7d0f20d8f137330cf::::
samim:{plain}23b82f0b10a802d25f308960c6071b151e3c37b6::::
monibul:{plain}8da4d1ae5e520ff8fadd415cfbfbafc8fcebb367::::
owasim:{plain}7ef9cf46165c4729e09fc142432cd892e3365c44::::
office:{PBKDF2}$1$9b5a900650285343$5000$1d041a5a6caea807e26b8ff4b41e5389bb4b
4427::::/opt/mailstore/common/.Office::userdb_mail=maildir:~/
banking:{PBKDF2}$1$429b69dc44c46b33$5000$25a4b4c106c3fa69a6890253aa9163b66f0
13d48::::/opt/mailstore/common/.Banking::userdb_mail=maildir:~/
gmail:{PBKDF2}$1$4fadc2241bf79ee5$5000$6b6db95f72fbe2d9dcd311fdad6f614302e98
da7::::/opt/mailstore/common/.Gmail::userdb_mail=maildir:~/
automail:{PBKDF2}$1$549cf6f14ab5ceb0$5000$a18fe676ca716148ab1ba75f225044a960
420bbf::::/opt/mailstore/common/.Automail::userdb_mail=maildir:~/

Here is my dovecot.conf:


# 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.4
() # OS: Linux 4.19.0-13-amd64 x86_64 Debian 10.7 ext4 # Hostname:
dovecot.vbox.lan auth_mechanisms = plain login info_log_path =
/var/log/dovecot-info.log listen = 10.0.2.90 log_path = /var/log/dovecot.log
mail_attachment_dir = /opt/mailstore/attachments mail_location =
mdbox:/opt/mailstore/mdboxes/%u mail_plugins = acl namespace {
  list = children
  location = maildir:/opt/mailstore/common:INDEXPVT=~/.common
  prefix = Common/
  separator = /
  subscriptions = no
  type = public
}
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix =
  separator = /
  type = private
}
passdb {
  args = /etc/dovecot/dai/passwd-imapauth
  driver = passwd-file
}
plugin {
  acl = vfile:/etc/dovecot/dai/global-acl } protocols = imap lmtp service
imap-login {
  inet_listener imap {
    address = 127.0.0.1
  }
}
service imap {
  process_limit = 50
}
service lmtp {
  inet_listener lmtp {
    address = 10.0.2.90
    port = 24
  }
  user = vmail
}
ssl_cert = </etc/dovecot/dai/dai-dovecot.cert
ssl_key = # hidden, use -P to show it
userdb {
  args = /etc/dovecot/dai/passwd-imapauth
  default_fields = uid=vmail gid=vmail home=/opt/mailstore/mdboxes/%u
  driver = passwd-file
}
protocol imap {
  mail_max_userip_connections = 2
  mail_plugins = acl imap_acl
}
protocol lmtp {
  auth_username_format = %n
}




--
It's all in the mind, ya know.




More information about the dovecot mailing list