Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging two dovecot Maildirs

I recently setup mail server using zpanel (with dovecot and Maildir format) for my domain and created a user email account with [email protected] here.

Here all the emails are stored in following tree in server under /var/zpanel/vmail/ path

my-domain.com
  |--> cur/
  |  ------
  |--> new/
  |  ------
  |--> tmp/
    ------

I have all user email from my old server (in same format as above). Where email server for my domain my-domain.com was be hosted before.

Problem is, I already have few emails on new server for user and I want to merge both so that it show up all email which I sent from New email server and old one.

Is there any way, I can merge these two maildirs?

like image 773
lalit Avatar asked May 10 '13 07:05

lalit


1 Answers

Sorry, But I figured out how we can do it. Just answering my question here so that will be useful for others as well.

We can do it using simple filesystem merge for directories but after that we need to make sure that we give appropriate permission to all files for vmail user (user might be specific to zpanel).

This is what worked for me . Under /var/zpanel/vmail/my-domain.com/cur/:

$ sudo chown vmail:mail *

Same we need to do for /new and /tmp directories.

like image 173
lalit Avatar answered Sep 30 '22 20:09

lalit