Mail delivery problem: Maildir path problem
10:17 06 Feb 2026

I want to set up a mail server on my local network on my computer and use virtual users with the Postfix (v3.10.5) and Dovecot (v2.4.1-4) plugins, but I've run into an error that I can't figure out.

When I created virtual users on the vmail user, for some reason I cannot set the correct mail storage location. The %n should stand for my virtual user, but for some reason it creates a folder under that name.

/etc/postfix/vmaps 
email1 mail/email1/ 
email2 mail/email2/
auth-passwd-file.conf.ext 

passdb passwd-file { 
    driver = passwd-file 
    passwd_file_path = /etc/dovecot/passwd 
} 
userdb static { 
    driver = static 
    fields { 
        uid = 5000 
        gid = 5000 
        home = /home/vmail/mail/%n 
    } 
}
10-mail.conf 
mail_driver = maildir 
mail_home = /home/vmail/mail/%n 
mail_path = /home/vmail/mail/%n

And the user looks like that

sudo doveadm user email1 
field   value 
uid     5000 
gid     5000 
home    /home/vmail/mail/%n 
mail_path       /home/vmail/mail/%n
cat /etc/dovecot/passwd
email1:{PLAIN}123::::::
email2:{PLAIN}123::::::

When instead of /home/vmail/mail/%n there should be /home/vmail/mail/email1

Also, when I try to send emails to that virtual email they don't appear in Thunderbird although according to the logs, the message was sent successfully, for some reason it ends up in a different folder.

/home/vmail/mail# ls email1/ cur Maildir new tmp 
/home/vmail/mail# ls email1/new/ 1770387499.V801I2bf96aM854426.phonemail.7aa.mail /home/vmail/mail# ls email1/Maildir/new/

It should be in /home/vmail/mail/email1/Maildir/new and not there.
If I need to show more settings, just let me know!

linux email postfix-mta dovecot