Email-addresses expansion doesn't work on Email forwards to same domain

Preamble: We have configured usernames to be (This results in Unix Usernames being

I created an email address:

and added forward:

That got accepted. However, postfix returned mails to sender to email with users membera and memberb unknown.

I could do a workaround with a forward to:

Looks like postfix was playing "smart" removing then looking for unix users...

But that is beyond normal hosting users skills, so maybe accepting the normal way to write the forwards could be cool for normal users. ;-)

So from a normal user perspective this is a bug imho.



That does look like a bug ..

If you check the /etc/postfix/virtual file for the coreteam alias, what is listed?

You can find these with a command like :

grep coreteam /etc/postfix/virtual /etc/aliases

This is original form (which fails on forwarding mails):

grep coreteam /etc/postfix/virtual /etc/aliases

This is with the worked-around aliases:

grep coreteam /etc/postfix/virtual /etc/aliases

Ok, thanks .. one more question - do membera and memberb have their "Primary email address" enabled on the Edit Mailbox page?

Ah, Also our sanity check of system health does choke that: 1) in passwd file, the users have 2 entries 2) that unix usernames are very long (over 16 characters if I remember the warning message) I didn't see any problems with those 2 items, so ignored safely.

e.g.: (changed values to not expose anything):

I did some testing to replicate this problem, but found that the setup you describe actually works fine.

The only case in which it fails is if the Virtualmin domain has the same name as the system's hostname (or the domain part of the hostname). Is that perhaps the case on your system?

yes, the Virtualmin domain has EXCACTLY the same name as the system's hostname in the reported case.

Sorry, didn't realize that would matter for the bug report.

This can cause problems for Postfix actually, as it gets the virtual domain confused with the hostname.

The fix is to change the hostname to something like instead of just Also, be sure to change the /etc/mailname file, and any use of in the /etc/postfix/ file, and then restart Postfix.