Ok I started figuring out something.
After adding domain.com to $mydestination in mail.domain.com ( Webmin > Servers > Postfix Mail Server > General Options > What domains to receive mail for ), then Postfix will accept mail sent to domain.com.
However, it will then look for an actually existing user. So, it will deliver only to usernames that actually exist as linux accounts (this is the way Virtualmin works as opposite to using virtual email addresses in the database).
So for example user1@mail.domain.com is in reality named after the account owner (= mail.domain) so the real username will be user1.mail.domain.
Therefore if I send a message to user1.mail.domain@domain.com, the message gets successfully delivered to the inbox of user1.mail.domain@mail.domain.com (after I add domain.com to $mydestination).
But, if I send a message to user1@domain.com, then it bounces with :
Recipient address rejected: User unknown in local recipient table
The reason it bounces is of course that there is no such user named “user1” on the linux box.
So what needs to be done next is to create an alias that maps user1@domain.com to user1.mail.domain.
Not only that, but also the @domain.com mail aliases need to be mapped to @mail.domain.com aliases (such as the hostmaster@, webmaster@ etc default email aliases).
Finally, the outgoing mail needs to be somehow rewritten so that instead of being from @mail.domain.com , it appears as from @domain.com
If someone can help me here I’d appreciate it. If not, I’ll have to keep RTFMs.