Mail error cant recieve mail

SYSTEM INFORMATION
OS type and version Ub 24.04
Webmin version latest
Virtualmin version Latest
Webserver version Apache2
Related packages SUGGESTED

I have spun up a fresh Ubuntu 24.04 server with Virtualmin. I have setup a mail accounton it and configured dns with DKIM, DMARC, SPF, MX
I can send from the server but I cant recieve any thing.
The srver from Conabo has a default hostname but I have change it in hosts, hostname and mail.cf
But when I try to send mail to the new server it bounce log below.
From where comes vmi2683797.contaboserver.

This is the mail system at host server.hobbycharken.org.

I’m sorry to have to inform you that your message could not
be delivered to one or more recipients. It’s attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<“anders@hobbycharken.org”@vmi2683797.contaboserver.net> (expanded from
<anders@hobbycharken.org>): mail for vmi2683797.contaboserver.net loops
back to myself

Reporting-MTA: dns; server.hobbycharken.org
X-Postfix-Queue-ID: 6E9318D9CE
X-Postfix-Sender: rfc822; anders.yuran@pissouri.org
Arrival-Date: Tue, 15 Jul 2025 16:39:14 +0200 (CEST)

Final-Recipient: rfc822; “anders@hobbycharken.org@vmi2683797.contaboserver.net
Original-Recipient: rfc822;anders@hobbycharken.org
Action: failed
Status: 5.4.6
Diagnostic-Code: X-Postfix; mail for vmi2683797.contaboserver.net loops back to
myself

Get your provider to change your host name. Most likely your local config changes can’t override their set up for your server.

Its not a provider problem. They dont setup anything. Only default when they spin up a new vps. So it is still somewhere in the mail setup

MX lookup from sender

root@mailserver:~# dig +short MX hobbycharken.org
10 server.hobbycharken.org.
root@mailserver:~#

@Mediasafe,

Are both domains setup on the server in Virtualmin, and also have “Mail” turned on for them?

*** It appears both domains are hosted on the same server in this case ***

no. one is iredmail server one a vps without virtualmin and the other one is a virtualmin server

The error looping back to myself indicates a postfix configuration error, perhaps have an in depth look at the postfix config for errors or employ @tpnsolutions to fix it for you

The domain hobbycharken.org was before hosted on the same server but not anymore. So the problem is for sure the old server somehow remember it. But I cant find anymore trace in any postfix config ore anywhere else.

This problem is now solved by wiping the vps and reinstall Ubuntu/virualmin. I think the problems came from that I forgot to change the hostname before installling virtualmin. The installation then used the default hostname everywhere and even if I changed it after virtualmin install it somehow stayed for postfix, dovecot etc. Now after reinstall everything works flawless. Something to have in mind when installing Virtualmin

Well I can clearly now see that the error came from installing Virtualmin with in this case the default hostname. I have another server installed at the same time that have the same problem. error text below. Perhaps something can be done to avoid this problem
his is the mail system at host mail.jv80.se. I’m sorry to have to inform you that your message could not be delivered to one or more recipients. It’s attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system <“order@jv80.se”@vmi2698749.contaboserver.net> (expanded from order@jv80.se): mail for vmi2698749.contaboserver.net loops back to myself

Reporting-MTA: dns; mail.jv80.se X-Postfix-Queue-ID: 6E1B98985C X-Postfix-Sender: rfc822; anders.yuran@pissouri.org Arrival-Date: Wed, 16 Jul 2025 21:33:27 +0200 (CEST) Final-Recipient: rfc822; “order@jv80.se”@vmi2698749.contaboserver.net Original-Recipient: rfc822;order@jv80.se Action: failed Status: 5.4.6 Diagnostic-Code: X-Postfix; mail for vmi2698749.contaboserver.net loops back to myself

if you do that. it works every time in my experience

Yea I now. At the same time this is something that happens. The problem is it seems to be impossible to find this vmi2698749.contaboserver.net and change it. I have 2 production email server using iredmail so no CP like Virtualmin, and it has been no problem to change hostname.

But now I know and it will never happen again.

This indicates you have an error in the configuration, you need to fix that

Well we have worked 8 hours to find where this default hostname is stored, but nothing. So in the end I just copied the public_html and dumped the db. Then reinstalled the server, CHANGED to correct hostname and then reinstalled Virualmin. Restored the db and public_html and directly everything work flawlesss. That lesson I will never forget

Nu need. I have 100% control of the server. And to change hostname is nothing the provider should bother about, and they dont. The problem is that Virtualmin use the default hostname everywhere during installation if you dont change it before. Then it is not possible to find where it is. But now I have learned what to do the hard way