To be clear… not all emails bounce… but every time the server is rebooted, then when emails are sent from the server, in the email headers is says that it is from server.localdomain and that causes some emails to be rejected and bounce…
When I manually change the hostname from server to server.mydomain.com, then the email headers show the email to be coming from server.mydomain.com and they are ok.
And also my postfix settings are as follows:
In webmin: What domain to use in outbound mail: Use domainname What domain to receive mail for:$myhostname, localhost.$mydomain, localhost, $mydomain
That’s a legit 5xx error. It means the address you are sending to DOES NOT EXIST. Hence the receiving server is saying, “Return to Sender, Address Unknown”.
Not the same thing… when I get address does not exist it looks like this:
550-5.1.1 The email account that you tried to reach does not exist.
or
552 1 Requested mail action aborted, mailbox not found
And I confirm that after correcting the hostname the emails were delivered correctly. The issue is that when the server is rebooted and the hostname changes to just “server” then emails as sent from host server.localdomain instead of from the FQDN and that causes some emails to bounce…
Hence my need to find a way to make the changes permanent in the linux container that I am using… I’ve tried many things even with Postfix to no avail.
Is it a VPS , and has your Hoster a kind of/or cloudinit config for that?
Then with reboots that config/settings is often used from that cloudinit enviroment / config
So files as ( 1 example) resolved.conf are placed back from your default install and your hoster.
You have then set the hostname right in your Hosters control panell!