Actually for the past 1 week I am trying to open imap port in my mail server using iptables. I tried many things but still it is not opened. I am trying to configure evolution mail client with imap port 143 but it shows error
Error while Scanning folders in "IMAP server incomingservername"
Could not connect to incomingservername: Connection refused"
Hope someone will help me, Thanks in advance.
Chain INPUT (policy ACCEPT 6461K packets, 869M bytes)
pkts bytes target prot opt in out source destination
40 2290 ACCEPT all -- any any localhost.localdomain anywhere
12999 3431K ACCEPT tcp -- any any anywhere anywhere tcp dpt:http
0 0 ACCEPT tcp -- any any anywhere 10.0.0.0 tcp spts:1024:65535 dpt:imap state NEW,ESTABLISHED
0 0 ACCEPT udp -- any any anywhere anywhere udp spt:imap dpts:1024:65535 state NEW,ESTABLISHED
0 0 ACCEPT udp -- any any anywhere anywhere udp spts:1024:65535 dpt:imap state NEW,ESTABLISHED
0 0 ACCEPT tcp -- any any anywhere 10.0.0.0 tcp spt:imap dpts:1024:65535 state ESTABLISHED
0 0 ACCEPT tcp -- any any anywhere 10.0.0.0 tcp spts:1024:65535 dpt:smtp state NEW,ESTABLISHED
120 10016 ACCEPT tcp -- any any anywhere anywhere tcp spt:smtp dpts:1024:65535 state ESTABLISHED
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 216K packets, 61M bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- any any 10.0.0.0 anywhere tcp spt:imap dpts:1024:65535 state ESTABLISHED
0 0 ACCEPT tcp -- any any 10.0.0.0 anywhere tcp spts:1024:65535 dpt:imap state NEW,ESTABLISHED
0 0 ACCEPT tcp -- any any 10.0.0.0 anywhere tcp spt:smtp dpts:1024:65535 state ESTABLISHED
127 68842 ACCEPT tcp -- any any anywhere anywhere tcp spts:1024:65535 dpt:smtp state NEW,ESTABLISHED
netstat -an|grep 143 this gives no result!!!!!!!!!!!!!!!1:-(
sudo ufw disable sudo: ufw: command not found
Best Answer
It doesn't look like your firewall is doing anything, the policies are all to ACCEPT and all of the rules are ACCEPT.
Try disabling your firewall and see what happens.
The error message your seeing says
Connection refused
this generally means that there isn't anything listening on the relevant port. Check your service is running and check that it's configured to listen on the correct interface and port.