Email Domain Aliases don't appear to work

,

NethServer Version: 7.6.1810

Hello Nethserver Community,

Firstly, thanks to everyone who has contributed to creating and maintaining this great platform. It’s really easy to use and, in general, “just works” :slight_smile:

I have, however, run into a problem with mail domain aliases.

I’m not trying to do anything complex, and have found lots of previous posts about having separate user lists, etc, etc.

I just want the regular userlist (we’re using integrated Samba AD for Accounts provider) to be available at multiple domains.

So, user1@domain1, user1@domain2, user1@domain3 and so on.

All domains have publicly accessible DNS records and entries in the LE certificate.

All are entered into the UI as domain list entries with “Deliver Locally” set.

All appear in the Postfix main.cf file listed in “virtual_alias_domains”

None of them work :frowning:

All mail for any user (and I’ve tried many users) is bounced with “550 5.1.1 : Recipient address rejected: User unknown in virtual alias table”

Email is only accepted for the primary domain.

The same result occurs whether from the outside, using Webtop, or even mail in a shell.

The only addresses that DO go through (and they do so for all listed domains) are mailboxes that have an individual mail alias pointing at them. So if I have nickname1 aliased to user1@primary.domain then email to nickname1@domain2/3/4/5 will get accepted and delivered correctly.

I’ve tried with domains that are sub-domains of the main domain, as well as others that are totally unrelated. The results are the same.

Reading the Postfix documentation it looks like it’s all set correctly. It just doesn’t appear to work.

I’m stumped and really hoping that I’ve missed something (even if it’s obvious).

All ideas welcome.

Thanks,

Matt

Hi Matt, really welcome to our community!

I think it is the expected behavior, according to Email — NethServer 7 Final

Hi David,

Thanks for your reply.

So it’s my understanding of the domain aliasing that is wrong. The Domain Alias is an alias for the machine, but it doesn’t automatically extend to all the user accounts on that machine.

So every user gets a mailbox that is automatically in the primary domain, and the creation of email addresses in secondary domains has to be done one by one with individual aliases.

Thanks for helping me understand that :slight_smile:

Cheers,

Matt

1 Like

Furthermore, it is possible to create a “wildcard” alias that matches any domain too (eg useralias@…)

Yeah, thanks. I knew about the wildcard on the right side, but assumed there would be one on the left. I was wrong :expressionless:

All good now :slightly_smiling_face:

Cheers,

Matt

1 Like

Not sure if the solution I use is relevant here. I have the situation where there are multiple mail domains/sub-domains to accept and all I wanted to achieve was postfix to auto rewrite the domain portion of the address to deliver to the prime domain mailbox.

eg: {username}@<second.domain> is accepted, rewritten and delivered to {username}@<primary.domain> without needing to add an email alias for each user.

To do this, I have added: canonical_maps = regexp:/etc/postfix/rewrite to /etc/postfix/main.cf
and added the following regex line to a file: /etc/postfix/rewrite:
/^(.*)@secondary\.com$/ $1@primary.com
(add other domains similarly - each to a new line)

The server will still only accept legitimate users/aliases and reject unknowns (ie it isn’t a catchall).

Of course to do this, you will create a template fragment such as:
/etc/e-smith/templates-custom/etc/postfix/main.cf/20canonical_maps
expand the template: expand-template /etc/postfix/main.cf
and restart postfix: systemctl restart postfix

This is working for me with multiple domains and sub-domains both externally and internally (eg via webtop).

Klaus

2 Likes