SENT email folders empty after migration

SYSTEM INFORMATION
OS type and version Ubuntu 24.04 server
Webmin version 2.111

Hi, I migrated my virtual servers from ubuntu 22.04 to 24.04 and noticed that inbox emails are thre but the sent emails in all email user accounts (in outlook) are all empty across multiple virtual servers. So thought to check /home/user/Maildir and noticed that it is only 5MB instead of 6GB or so (regardless, all user/Maildir for each virtual server is small size < 6MB).

ls -al /home/xyz/Maildir/

total 76
drwx------ 9 xyz xyz 4096 Jun 27 21:00 .
drwxr-x— 27 xyz xyz 4096 Aug 7 15:53 …
drwx------ 5 xyz xyz 4096 Feb 11 2022 .Drafts
drwx------ 5 xyz xyz 4096 Feb 11 2022 .Sent
drwx------ 5 xyz xyz 4096 Feb 11 2022 .Trash
drwx------ 5 xyz xyz 4096 Jun 27 21:00 .spam
drwx------ 2 xyz xyz 4096 Feb 11 2022 cur
drwx------ 2 xyz xyz 40960 Jul 13 04:49 new
-rw-r–r-- 1 xyz xyz 18 Feb 11 2022 subscriptions
drwx------ 2 xyz xyz 4096 Jul 13 04:49 tmp

So I checked other directories in /home/xyz/ and found that /home/xyz/homes/ directory has one folder for each email user, e.g.

ls -al /home/xyz/homes/

total 104
drwxr-xr-x 26 xyz xyz 4096 Aug 8 23:34 .
drwxr-x— 27 xyz xyz 4096 Aug 7 15:53 …
drwxr-x— 6 admin@domain.com xyz 4096 Aug 6 00:08 admin
drwxr-x— 5 bcptest@domain.com xyz 4096 Aug 6 00:08 bcptest
drwxr-x— 6 billing@domain.com xyz 4096 Aug 6 00:09 billing
drwxr-x— 6 contact@domain.com xyz 4096 Aug 6 00:09 contact
drwxr-x— 6 customer@domain.com xyz 4096 Aug 6 00:09 customer
drwxr-x— 6 default@domain.com xyz 4096 Aug 6 00:09 default
drwxr-x— 6 dmarc@domain.com xyz 4096 Aug 6 00:09 dmarc
etc. rest of the users.

/home/user/homes/ size is also coming to about 6GB which sounds better than just 5MB that Maildir folder had.

Upon further checking further, /home/user/homes/ folder also has Maildir as well as mail folders inside email user’s name folder.

What are all the relevant settings that points to location from where the system will check email folder contents for synchronizing with clients (outlook) ?

  1. On previous server ubuntu 22.04 where emails were fine including Sent folder emails,
    root@TempDel:~# ls -al /home/xyz/homes/user1/
    total 20
    drwxr-x— 5 user1@domain.com xyz 4096 May 1 2022 .
    drwxr-xr-x 25 xyz xyz 4096 Jul 31 05:23 …
    drwx------ 11 user1@domain.com xyz 4096 Aug 5 12:46 Maildir
    drwx------ 2 user1@domain.com xyz 4096 Aug 6 00:02 .spamassassin
    drwx------ 4 user1@domain.com xyz 4096 Apr 30 2022 .usermin
    root@TempDel:~# ls -al /home/xyz/homes/user1/Maildir/
    total 8988
    drwx------ 11 user1@domain.com xyz 4096 Aug 5 12:46 .
    drwxr-x— 5 user1@domain.com xyz 4096 May 1 2022 …
    drwx------ 2 user1@domain.com xyz 905216 Aug 2 02:39 cur
    -rw------- 1 user1@domain.com xyz 239432 Jul 29 05:08 dovecot.index
    -rw------- 1 user1@domain.com xyz 7372660 Aug 5 12:46 dovecot.index.cache
    -rw------- 1 user1@domain.com xyz 23204 Aug 2 02:43 dovecot.index.log
    -rw------- 1 user1@domain.com xyz 59 Apr 30 2022 dovecot-keywords
    -rw------- 1 user1@domain.com xyz 968 Jul 29 08:10 dovecot.list.index
    -rw------- 1 user1@domain.com xyz 3204 Aug 5 04:05 dovecot.list.index.log
    -rw------- 1 user1@domain.com xyz 72 May 3 2022 dovecot.mailbox.log
    -rw------- 1 user1@domain.com xyz 581400 Aug 1 21:55 dovecot-uidlist
    -rw------- 1 user1@domain.com xyz 8 May 3 2022 dovecot-uidvalidity
    -r–r–r-- 1 user1@domain.com xyz 0 Apr 30 2022 dovecot-uidvalidity.626ce858
    drwx------ 5 user1@domain.com xyz 4096 Jul 7 11:01 .Drafts
    drwx------ 5 user1@domain.com xyz 4096 Oct 1 2023 .Junk
    drwx------ 2 user1@domain.com xyz 4096 Aug 6 00:02 new
    drwx------ 5 user1@domain.com xyz 4096 Oct 16 2022 .Notes
    drwx------ 5 user1@domain.com xyz 4096 Aug 5 12:46 .Sent
    drwx------ 5 user1@domain.com xyz 4096 Jul 28 22:22 .spam
    -rw------- 1 user1@domain.com xyz 40 May 3 2022 subscriptions
    drwx------ 2 user1@domain.com xyz 4096 Aug 6 00:02 tmp
    drwx------ 5 user1@domain.com xyz 4096 Aug 5 03:59 .Trash
    root@TempDel:~# du -hs /home/xyz/homes/user1/Maildir/
    4.3G /home/xyz/homes/user1/Maildir/

  2. On new ubuntu 24.04 server where virtualmin backups from previous server were restored to without error and on this new server inbox emails appears to be ok. But all sent folders are empty.
    root@host1:/home/sudoUser1# ls -al /home/xyz/homes/user1/
    total 24
    drwxr-x— 6 user1@domain.com xyz 4096 Aug 6 00:08 .
    drwxr-xr-x 26 xyz xyz 4096 Aug 8 23:34 …
    drwx------ 2 user1@domain.com xyz 4096 Aug 8 23:40 .spamassassin
    drwx------ 4 user1@domain.com xyz 4096 Apr 30 2022 .usermin
    drwx------ 11 user1@domain.com xyz 4096 Aug 9 09:42 Maildir
    drwxr-xr-x 2 user1@domain.com xyz 4096 Aug 6 00:11 mail
    root@host1:/home/sudoUser1# ls -al /home/xyz/homes/user1/Maildir/
    total 8128
    drwx------ 11 user1@domain.com xyz 4096 Aug 9 09:42 .
    drwxr-x— 6 user1@domain.com xyz 4096 Aug 6 00:08 …
    drwx------ 5 user1@domain.com xyz 4096 Aug 9 03:26 .Drafts
    drwx------ 5 user1@domain.com xyz 4096 Aug 9 03:26 .Junk
    drwx------ 5 user1@domain.com xyz 4096 Aug 9 03:26 .Notes
    drwx------ 5 user1@domain.com xyz 4096 Aug 9 03:26 .Sent
    drwx------ 5 user1@domain.com xyz 4096 Aug 9 03:26 .Trash
    drwx------ 5 user1@domain.com xyz 4096 Aug 9 03:26 .spam
    drwx------ 2 user1@domain.com xyz 917504 Aug 8 23:56 cur
    -rw------- 1 user1@domain.com xyz 59 Apr 30 2022 dovecot-keywords
    -rw------- 1 user1@domain.com xyz 581485 Aug 8 23:56 dovecot-uidlist
    -rw------- 1 user1@domain.com xyz 8 May 3 2022 dovecot-uidvalidity
    -r–r–r-- 1 user1@domain.com xyz 0 Apr 30 2022 dovecot-uidvalidity.626ce858
    -rw------- 1 user1@domain.com xyz 239504 Aug 8 22:56 dovecot.index
    -rw------- 1 user1@domain.com xyz 6410140 Aug 8 23:56 dovecot.index.cache
    -rw------- 1 user1@domain.com xyz 1580 Aug 9 00:26 dovecot.index.log
    -rw------- 1 user1@domain.com xyz 103224 Aug 8 22:56 dovecot.index.log.2
    -rw------- 1 user1@domain.com xyz 3120 Aug 8 23:04 dovecot.list.index.log
    -rw------- 1 user1@domain.com xyz 72 May 3 2022 dovecot.mailbox.log
    drwx------ 2 user1@domain.com xyz 4096 Aug 8 23:56 new
    -rw------- 1 user1@domain.com xyz 40 May 3 2022 subscriptions
    drwx------ 2 user1@domain.com xyz 4096 Aug 8 23:40 tmp
    root@host1:/home/sudoUser1# ls -al /home/xyz/homes/user1/mail/
    total 1952120
    drwxr-xr-x 2 user1@domain.com xyz 4096 Aug 6 00:11 .
    drwxr-x— 6 user1@domain.com xyz 4096 Aug 6 00:08 …
    -rw-r–r-- 1 user1@domain.com xyz 0 Aug 6 00:10 Drafts
    -rw-r–r-- 1 user1@domain.com xyz 0 Aug 6 00:10 Junk
    -rw-r–r-- 1 user1@domain.com xyz 687 Aug 6 00:11 Notes
    -rw-r–r-- 1 user1@domain.com xyz 1998868215 Aug 6 00:11 Sent
    -rw-r–r-- 1 user1@domain.com xyz 0 Aug 6 00:11 Trash
    -rw------- 1 user1@domain.com xyz 968 Jul 29 08:10 dovecot.list.index
    -rw------- 1 user1@domain.com xyz 3204 Aug 5 04:05 dovecot.list.index.log
    -rw-r–r-- 1 user1@domain.com xyz 75922 Aug 6 00:10 spam
    root@host1:/home/sudoUser1# du -hs /home/xyz/homes/user1/Maildir/
    2.5G /home/xyz/homes/user1/Maildir/
    root@host1:/home/sudoUser1# du -hs /home/xyz/homes/user1/mail/
    1.9G /home/xyz/homes/user1/mail/

So as you can see that after migrating to new server (restore from virtualmin backups) it looks like the Maildir inside user1 directory has 2.5G and mail folder inside the user1 directory has 1.9G and total in source server is total of these two as 4.3GB
And closer look at mail folder’s ls -al you can see that sent folder is taking quite some space. So it appears that Sent folder is moved to user1/mail and inbox seem to have moved to user1/Maildir

But why? And how to fix this to bring it back to the state of source server and then also restore the new emails on top? Especially Sent folder as Inbox is up to date on new server. It is just the Sent folder that is totally empty.

Fixed it by just copying .Sent folder from source server to target server (original to new server), setting permissions and indexing dovecot before restarting dovecot. That started pulling the sent folder emails to the outlook.
Hopefully this helps someone.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.