I am part of a team for a startup project where currently we have dozens of domains registered and hosted in OVH, and where only 5 (main) ones are currently being pulled into Virtualmin as the rest of the domains have yet to have their front ends designed and built. We have users created for the administration team, as well as a programming team which accesses via SFTP to upload content to the websites. Therefore, the system is already in production albeit early-stage. We’re getting a reasonable amount of monthly page visits which I obviously don’t want to disturb. At the same time, without a functioning mailing system these users aren’t capable of reaching out to us. On top of that, we currently cannot use other services that would require these e-mail accounts.
I do have etckeeper installed, but I am not familiar with it.
In the meantime I renamed the system hostname from “example.com” to “host.example.com”, or should I just change the domain altogether to another example, e.g., “host.example2.com”?
A while ago I did change some Dovecot configurations but it must’ve been at least a couple of months ago. I could also open up another topic on this later, if the current one doesn’t fix the issue.
Literally any name other than a name hosted virtually will work fine. host.example.com is fine. There is no “better” here. Any name that resolves is fine, as long as you aren’t also virtually hosting the same name. You just can’t have two things with the same name.
Thank you so much for the help so far. I will look into etckeeper as you recommended and look into my backups to see what I can find regarding Postfix files.
Given my production environment, what would you recommend I should do from here on out?
Also, since this topic has been solved I could just close it for now and open up a new one later once I get some progress of my own with your advice.
After changing the system hostname I tried the e-mail system once more and the error received now is “mail for [HOSTNAME] loops back to myself” - received as a bounced e-mail with the subject “Undelivered Mail Returned to Sender”.
EDIT: I remember reading a post here about this error last night and so I went to check if the Primary email address for this account was “Enabled” and it was not, for some reason.
Sending a new e-mail from the gmail account out to one of the VPS-hosted accounts outputs the following into the mail.log file:
2024-12-13T00:54:18.002387+00:00 globaltradin postfix/smtp[1092094]: 06AC2138CC7: to=<[redacted_email]>, relay=gmail-smtp-in.l.google.com[74.125.206.26]:25, delay=0.97, delays=0/0/0.31/0.66, dsn=5.7.26, status=bounced (host gmail-smtp-in.l.google.com[74.125.206.26] said: 550-5.7.26 Your email has been blocked because the sender is unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM. 550-5.7.26 550-5.7.26 Authentication results: 550-5.7.26 DKIM = did not pass 550-5.7.26 SPF [] with ip: [redacted_ip] = did not pass 550-5.7.26 550-5.7.26 For instructions on setting up authentication, go to 550 5.7.26 https://support.google.com/mail/answer/81126#authentication [redacted_unique_id] - gsmtp (in reply to end of DATA command))
You’re still giving Postfix mixed messages about virtually hosted domains vs what Postfix itself is.
I’ll repeat my advice from earlier about mydestination. If you added your virtually hosted domains there, you broke it. myorigin and some of the other my options may also lead to this problem. Virtually hosted mail should not also be configured at the Postfix main.cf layer. No domains in Virtualmin should be listed in your main.cf (again, you’re trying to make Postfix do two different things with mail for a given domain, it doesn’t make sense, virtual is one thing, main.cf is another).
Of course, I’m assuming you restarted Postfix after making the system hostname change. And, I assume you’ve confirmed the change is actually working as expected. When you do hostname -f and hostname do you get the new name, as you expect? (This warning can happen when the hostname matches a virtually hosted name in some circumstances.)
This has happened at one point (although only one of the domains was listed), but currently it only reads mydestination = localhost, localhost.localdomain; is this still an issue? I could use the default via the Virtualmin interface, which I think would be the same as simply omitting this line from the main.cf file.
Both of these commands show the new system hostname that is in place.
I thought the same as it mentions SPF/DKIM authentication - I can review these momentarily. In the past I have made sure to match a domain’s DNS records listed in OVH and the ones listed in Virtualmin. Last time I did this I spent a good time on it, but I could do definitely do another review if you believe the source of the issue lies there now.
Nope, that’s unrelated. That means you’re trying to send mail to a non-GMail hosted address via GMail. That’s also a misconfiguration of some sort, but unrelated to the “mail loops back to myself” warning.
It may be related to MX records, but it isn’t the same problem as “mail loops back to myself”.
I just remembered now, could this be the Reverse DNS path in OVH? When I updated the system hostname in Virtualmin, I should’ve also updated this entry to reflect the new hostname change?
Does your PTR record resolve to a hostname virtually hosted in Virtualmin? If so, yeah, you should fix that to match the new system hostname (though PTR doesn’t actually have to match anything, it just needs to resolve both ways and it needs to not be a name hosted virtually in Virtualmin).