I tried switching my MX record from the subdomain mail.mydomain.com to mydomain.com. Updating the Postfix and Dovecot configuration (SSL certs, hostname etc) worked mostly fine. Most e-mail addresses are used to forward mail, but there is a single (virtual) mailbox user managed by Dovecot. The username is mailer@mydomain.com, and his mail is stored at /var/mail/virtual/mailer@mydomain.com.

After changing the rest of the configuration, sending messages to mailer@mydomain.com (or one of its alias addresses) results in a Postfix error message:

<mailer@mydomain.com> (expanded from <postmaster@mydomain.com>): unknown user: "mailer"

In Postfix's main.cf, I have

virtual_mailbox_domains = mydomain.com
virtual_mailbox_maps = hash:/etc/postfix/mailbox_users
virtual_transport = lmtp:unix:private/dovecot-lmtp 

and mailbox_users contains a single line

mailer@mydomain.com OK

Postfix seems to look for a system user now (without the domain), not the Dovecot user mailer@mydomain.com – which Dovecot/Postfix settings should be changed to solve this problem?

Thanks, Jan

  • Did you modify mailbox_users? If yes, did you run postmap on it? Sep 13 at 8:34
  • Thank you – I found the solution (s. below).
    – janeden
    Sep 13 at 9:24

1 Answer 1


Problem solved: I had not changed the value of mydestination for Postfix, which included the updated myhostname (mydomain.com), so there was an overlap between mydestination and the virtual_mailbox_domains.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.