# Messages copied into a mailbox do not appear

UrbeStack sysadmin note about Dovecot. Last updated 30 Nov 2026.

Messages you copy into a mailbox as root do not appear in the mail client. Changing the ownership of the copied files lets Dovecot read them.

## Symptoms

After you copy a mailbox from another server or restore it by hand, some messages or entire folders are missing from the mail client. The storage figure from `doveadm quota get` reads `error`.

Look for Dovecot errors like these in `/var/log/maillog` on AlmaLinux or `/var/log/mail.log` on Ubuntu.

```output
Error: Mailbox INBOX: open(/home/USER/files/mail/example.com/user/cur/1764482402.M3P3.oldserver:2,S) failed: Permission denied (euid=1003(USER) egid=1003(USER) missing +r perm: ...)
```

```output
Error: Mailbox Archive: file_dotlock_create(/home/USER/files/mail/example.com/user/.Archive/dovecot-uidlist) failed: Permission denied (euid=1003(USER) egid=1003(USER) missing +w perm: /home/USER/files/mail/example.com/user/.Archive, dir owned by 0:0 mode=0755)
```

## Cause

UrbeStack keeps each mailbox in the customer's home directory. The customer owns the mailbox, and Dovecot reads and writes it as that customer.

Files and folders you copy as root stay owned by root. Dovecot cannot read those files or write to those folders. Messages copied with the customer's ownership appear the next time the mailbox is accessed.

## Resolution

Find the mailbox directory.

```
doveadm user -f home user@example.com
```

Set the owner of the directory and everything in it to the customer. Use the path the previous command printed.

```
chown -R USER:USER /home/USER/files/mail/example.com/user
```

Have Dovecot read the mailbox again and recalculate its quota usage.

```
doveadm force-resync -u user@example.com '*'
doveadm quota recalc -u user@example.com
```

Check that the storage figure is a number again.

```
doveadm quota get -u user@example.com
```

If the problem persists after you follow this note, you can [open a support ticket](https://support.urbestack.com/new?type=support). Including the output of the commands you ran helps support diagnose the problem.
