No mail can be sent or received: how to setup MX and work around port 25 block

Operating system:
OS version:
Operating system CentOS Linux 7.9.2009
Webmin version 1.973 Usermin version 1.823
Virtualmin version 6.16 Authentic theme version 19.73

Hello every one
after solving a ( dovecot couldnt start ) problem

no email can be sent or received, I read many in forum but could figure the problem

any help

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:

Also check the mail logs.

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:

  1. create an A record and point mail.domain.tld to Virtualmin’s IP
  2. 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:

A working MX would look like this:

Hi calport
i found this error
I am not sure it is related to mail send and receive or not
THE BIND DNS SERVER can not start
please advice on both errors

I can see from the DNS records of the domain you have mentioned that you are using a third party DNS service, so your ability to receive email is not dependent on Virtualmin’s DNS server.

You must configure MX for the domain to be able to receive mail, however.

I did both of them

the priority was set automatically to 10 . I didnt have control
till now no change

Well, then you should be able to receive mail after the DNS records propagate.

Any luck so far?

sending from hotmail to account was successful

senf from account to hotmail failed
it was not found even in junk box

That’s great, then. You have incoming mail working.

For outgoing mail, check if port 25 is open and if so, what the logs say.

Hoe to check port 25
where to get the log

You can view logs via Webmin

Search the forum for port 25 block

Search the Webmin log for actions …


No actions matched your search for actions between 04/12/2021 and 04/12/2021

Escape character is ‘^]’.
Connection closed by foreign host.

I used this command

netstat -anlp | grep :25

i got this result

tcp 0 0* LISTEN 1552/master
tcp6 0 0 :::25 :::* LISTEN 1552/master

I contacted ISP
they said their poly do not permit outgoing SMTP port
they directed to use smarthost

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.

I Added port 465 from firewall ID
when I try to change it to port 465 or 587
it just disappear
how to fix this?

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.

from what I understood

Yes, you need to use a smarthost / mail realy and the screenshot you have posted refers to one such service.

Again I say, do not go around changing ports arbitrarily. Read the documentation for the smarthost, it will outline the exact configuration changes that you need to make to use their service.

Virtualmin can be used to configure a smarthost via its GUI.

thanks alot calport