# Error connecting to IMAP server: localhost. 61: Connection refused



## egg3x (Jul 15, 2011)

Hi, all.

I have installed postfix and squirrelmail.

when i try to login to squirrelmail via web browser, error shown:


```
ERROR
Error connecting to IMAP server:localhost.
61 :Connection refused
```


And then i check via command line: 

```
telnet localhost 143

Trying 127.0.0.1
telnet: connect to address 127.0.0.1 Connection refused.
telnet: unable to connect to remote host
```
what is the problems? and what should i do?

Thank you!


----------



## SirDice (Jul 15, 2011)

Your IMAP service isn't running or it isn't bound to localhost.


----------



## egg3x (Jul 15, 2011)

SirDice said:
			
		

> Your IMAP service isn't running or it isn't bound to localhost.



Dear SirDice, can you tell me how to running IMAP in localhost?

Because, I am newbie in FreeBSD!


----------



## SirDice (Jul 15, 2011)

Install courier-imap or any one of the cyrus-imap versions.


----------



## DutchDaemon (Jul 15, 2011)

Or mail/dovecot, which is relatively easy. Make sure you tell it to listen on localhost in its configuration.


----------



## egg3x (Jul 20, 2011)

DutchDaemon said:
			
		

> Or mail/dovecot, which is relatively easy. Make sure you tell it to listen on localhost in its configuration.



Thank you. Now I can access to my Squirrelmail.

But now my squirrelmail can not send/receive email, the INBOX is empty.

Here is the message in the log file:


```
localhost postfix/smtp[1437] : 56D437E84D: to=<xxxxx@xxx.com> relay=none, delay=15,
 delays=0.16/0.17/15/0, dsn=4.4.4, status=deferred (Host or domain name not found. Name service error
 for name=mail.xxxxx.xom type=MX:Host not found , try again)
```

what is the problems that persist?

Note:I use postfix for local network


----------



## DutchDaemon (Jul 20, 2011)

Looks like a DNS error. Do you have a resolver set up (and working)?


----------



## egg3x (Jul 21, 2011)

DutchDaemon said:
			
		

> Looks like a DNS error. Do you have a resolver set up (and working)?



Here is my /etc/recolv.conf file:

```
domain xxxxxxx.com
search xxxxxxxx.com
nameserver  10.10.10.2 
nameserver  10.10.10.10
```

I do not know whether it is working or not? How to set up DNS? 

As I mention before, I use postfix / squirrelmail for local network.


----------



## DutchDaemon (Jul 21, 2011)

Are these 10.x.x.x IP addresses in a network on your server, and if so, do these DNS servers actually resolve the records you need? Post the output of [cmd=]ifconfig -a[/cmd] to begin with. If there is no 10.x.x.x network on your server, you will have to use a nameserver on a network that you do have access to (like your ISP's).


----------



## egg3x (Jul 22, 2011)

DutchDaemon said:
			
		

> Are these 10.x.x.x IP addresses in a network on your server, and if so, do these DNS servers actually resolve the records you need? Post the output of [cmd=]ifconfig -a[/cmd] to begin with. If there is no 10.x.x.x network on your server, you will have to use a nameserver on a network that you do have access to (like your ISP's).



Yes, those IP's are in my network.

Here is the ifconfig -a result:

```
ether 00:50:04:04:22:0a
inet 10.62.22.250 netmask 0xffffff00 broadcast 10.62.22.255
media: Ethernet autoselect (none)
status: no carrier
```

Do these DNS servers actually resolve the records you need? 
I do not know, I'm not sure. Do I have to change IP? All i want is postfix is running well on my local network. 

Note: I do not have ISP or internet connection for my LAN network.


----------



## DutchDaemon (Jul 22, 2011)

> status: *no carrier*



You are not connected to the network at all.


----------



## egg3x (Jul 25, 2011)

DutchDaemon said:
			
		

> You are not connected to the network at all.



Sorry the cable is not correctly plugged.  

Now status is : active.

But Error still appear, same as I mention above:


```
localhost postfix/smtp[1437] : 56D437E84D: to=<xxxxx@xxx.com> relay=none, delay=15,
 delays=0.16/0.17/15/0, dsn=4.4.4, status=deferred (Host or domain name not found. Name service error
 for name=mail.xxxxx.xom type=MX:Host not found , try again)
```


----------

