postfix, dovecot and usernames different to e-mail addresses

0

I want to replace an old mailserver setup with postfix+dovecot. The problem I'm facing now is, that the old system had usernames different to the e-mail address of the user. For example:

  • E-Mail-Address: foo@example.com
  • Username: foo-example.com

I configured postfix so that it passes mails to dovecot using the following command (master.cf):

dovecot      unix   -        n      n       -       -   pipe
  flags=DRhu user=mail-data:mail-data argv=/usr/lib/dovecot/dovecot-lda -a $(recipient)

When dovecot now receives an e-mail from postfix it logs

dovecot: lda(mail-data): Error: User initialization failed: Namespace 'INBOX.': Home directory not set for user. Can't expand ~/ for mail root dir in: ~/Maildir
dovecot: lda: Fatal: Invalid user settings. Refer to server log for more information.

I think dovecot is does not know that the username is not the e-mail address, but how can I tell him?

Furthermore we have alternative addresses here, so for example there may be an e-mail address bar@example.com owned by foo-example.com who has foo@example.com as primary address.

Ethan Leroy

Posted 2016-06-07T15:07:58.880

Reputation: 496

Answers

0

It took a long time to find this out. With the following configuration in master.cf dovecot now accepts my mails:

dovecot      unix   -        n      n       -       -   pipe
  flags=DRhu user=mail-data:mail-data argv=/usr/lib/dovecot/dovecot-lda
  -f ${sender} -d ${user}@${nexthop} -m ${extension}

Ethan Leroy

Posted 2016-06-07T15:07:58.880

Reputation: 496