25: Connection refused - Added IP to virtualmin server and new IP cannot receive email

Hi,

I added a second site to my virtualmin box with its own IP address.

For some reason when email is sent to the new domain/IP postfix refused the connection to 25.

If i set the mail server for the new domain to the host domain mail.1stdomain.com it works, mail.2nddomain.com does not work with:

error:
(postfix/smtp[17181]: connect to mail.2nddomain.com[1xx.xxx.xxx.xxx]:25: Connection refused

postfix is set to receive on all connections.

Any help would be appreciated!

Howdy,

What is the output of these two commands:

netstat -an | grep :25 iptables -L -n

Also, do emails to other domains work as expected?

-Eric

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 1xx.xxx.xx.86:25 0.0.0.0:* LISTEN
tcp 0 0 1xx.xxx.xx.84:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2525 0.0.0.0:* LISTEN
tcp6 0 0 :::2525 :::* LISTEN

.85 is the domain in question, which seems to not be listening. I checked this earlier and could have sworn i saw .25 (it was 8am though).

Yes other domains are working just fine.

as for iptables - I have completely disabled firewall (csf)

root@ns1:/var/log# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Howdy,

You may be seeing a problem with your /etc/postfix/master.cf file then. My suggestion is to review it, and make sure that there is an “smtp” line that contains the IP address you need to be listening.

-Eric

Thanks Andreycheck, that seems to have been the issue. Any idea why this would not have been automated when placing the account on its own ip?

Unfortunately, it may be a bug with Virtualmin setting what IP’s Postfix is listening on. There’s a few other folks who had reported something similar recently.

I have added this to my notes of things to discuss with Jamie.

-Eric

Well, that saved me the work to create a new thread with this bug.

I found the same problem here on a fresh virtualmin installation on a fresh installed debian 8 server. there are 12+1 ip adresses directing to the server (already during the installation) and everything is working fine with the “main ip”. but creating a new domain and attching it to another IP, no mails are working any more for that domain (smtp), but the apache is running. VERY frustrating and i spent hours to find that problem.

your solution this the missing IP in the master.cf is right. i found that one hour ago also: copying the line and entering the IP manually … brought smtp back to work.

but with my number of IP addresses it’s too much work to control everything manually.
is there a fix planned ?

regards,
Snop