If you disclose one of the domains that you are hosting on your Virtualmin instance, we could check and alert you about things such as the DNS records required to be set for mail to be sent and received.
For sending out mail, your service provider must permit you to use port 25 - not block it like many now do. In case port 25 is blocked for sending mail, see:
I found that this domain does not have a MX record. Till you add a MX record to the DNS records of the domain, it will be unable to receive email from the rest of the net. You could add a MX record in the control panel of your DNS provider such that it works with Virtualmin via the two step process listed below:
create an A record and point mail.domain.tld to Virtualmin’s IP
create a MX record for domain.tld and point it to mail.domain.tld priority 5
Then allow time for DNS propagation and check via this link:
You will have to use a smarthost / mail relay since your vps host / service provider has blocked port 25 for outgoing mail.
You were able to receive mail after you fixed your MX records and your VPS hosting service provider has stopped you from sending out email by blocking port 25. This brings the topic to a satisfactory conclusion, I think.
Can you share with us your intent to replace port 25 with 465 or 587?
Is it perhaps to work around the block on port 25 that your VPS hosting provider has specifically put up to stop you from sending out email? No, changing the port to 465 or 587 will not let you get around the limitation that your VPS host has imposed on your account. The only way forward for you is to use a smarthost / mail relay since your vps host / service provider has blocked port 25 for outgoing mail.
Oh, you had better undo your most recent changes and put 25 back else your system will not work normally even if you are able to convince your VPS host to remove the block on port 25.