Catch-all email address fails when hostname

I couldn’t find where to submit bugs, hence here.

In CentOS Linux release 8.3.2011, using virtualmin, if the hostname is also used as a catch-all email destination, e.g. example.org and in virtualmin you have an entry for @example.org, then emails to all other domains will also be redirected to this inbox, and the quick fix I found out was to change the hostname and restart postfix.

This is not a big issue, but it’d be nice to have it resolved as one usually uses main domain name as the hostname and that shows up when using SSH.

You should not use a bare domain (e.g. example.tld) as the hostname of your Virtualmin server, especially if you will be hosting that same domain name within Virtualmin.

e.g. these are good:

srv1.example.tld
main.example.tld
bob.example.tld
primary.example.tld

This is bad:

example.tld

In particular, it is bad if you create a domain in Virtualmin called example.tld and enable mail. I guess I should clarify that if you won’t be hosting mail on example.tld, you can name your server that without trouble, I think, but it’s still thinking about the problem the wrong way. This isn’t the name you will use to communicate with your customers, users, etc. The only names users should ever interact with will be the domain names managed in Virtualmin. Thinking of this name as the “main” domain on the server is asking for trouble (it leads people to fight with making SSL work, for instance, which seems to be very difficult for some users without a locally managed domain, and they’re fighting for no reason…it’s just a big time sink for everybody).

Don’t do bad. Your server hostname is not the “main domain” of your server. It’s just a name uniquely identifying the server. Your users, your customers, and you, should never need to use that system hostname for anything once you have domains in Virtualmin. It’s just the name of the hardware (or VM).

The hostname of your system should be fully-qualified, it should be able to resolve eventually (this may mean you need to create an A record for it in a Virtualmin domain later, and that’s fine, it does not need to resolve during installation), and it should not be the name of a domain you are hosting in Virtualmin if you’ll be receiving mail in that domain.

Edit: To be clear, this is not a bug. It is a documented requirement, From the docs: “We recommend you choose a name that is not one for which you will be receiving mail, in order to simplify later configuration.” But, I have added more clarification to the docs so hopefully it won’t trip anybody else up.

1 Like

Okay, so how did I manage to avoid any problems?

I have a virtual server with the same name as the hostname, with no content other than the picture of me with the bird on my shoulder. It also has a single email address hostmaster@server1.domain.tld. All the mandatory addresses alias to that address.

Never had a problem. Is that because the email address actually belongs to the virtual server? And if that’s the case, why would it make a difference if it were a production site rather than a picture of me with a finch?

Richard

You can configure Postfix to not treat the hostname as the destination. People mostly get that wrong and break other stuff, so I just pretend like it is impossible and tell people to not name their server with a hostname that will receive mail. There is no reason to do so, so…I tell people not to. It’s a time-saving tactic that also has the pleasant side effect of making Virtualmin easier to use and understand. I’m just trying to discourage people from going down complicated paths that provide no value.

1 Like

Ah, okay. I do remember spending an awful lot of time in Postfix the first time.

Is it acceptable to create aliases in the hostname to satisfy the RFC 2142 addresses?

Richard

If you’re not doing anything with the hostname, you do not need those addresses. But, yes, but those address don’t go in the virtual map table (that’s where the problem comes in…when you create a virtual map it’s supposed to be mapping, e.g. joe@virtualmin.com to local user joe-virtualmin or whatever, but if the server name is virtualmin.com, the mapping is to the same address, which is, well, wrong).

Just create aliases that point to a local user (no virtual map entries), if you want those addresses to exist.

1 Like

Okay, got it. Thanks.

Richard

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.