Monday 1 July 2013

How to Check POP3 and IMAP service.

Checking Service Availability

Log in to your server over SSH and input the following commands:

Test POP3

telnet localhost 110

Test IMAP

telnet localhost 143

If your POP3/IMAP services are running, you will see responses similar to the following:

POP3

Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Hello there

IMAP

Trying 127.0.0.1...
 Connected to localhost.localdomain (127.0.0.1).
 Escape character is '^]'.
 * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2004 Double Precision Inc. See COPYING for distribution information.

Testing login capability

You can perform a login attempt over telnet to these services quite easily.

POP3

Upon making the initial conneciton attempt, you should get the +OK Hello There message. Now do the following:
 
user username@example.com
+OK Password required.
pass PASSWORD
+OK logged in.
list
+OK POP3 clients that break here, they violate STD53.
 
TIP:
The +OK messages in between commands are server responses.

IMAP

Upon making the initial connection attempt, you should get the * OK [CAPABILITY IMAP4rev1...] message. Now do the following:
 
01 login username@example.com <password>

You should get the following response from the server:
 
01 OK LOGIN Ok.

Troubleshooting

If you make a connection attempt through either port 110(POP3) or 143(IMAP) and get a response similar to the following:
 
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused

This is an indication that the Courier-IMAP service is not running.
First, check if courier-imap is running:
 
ps ax | grep courier

If you see no output, try to start the Courier-IMAP service from the command line:
 
service courier-imap start

Check /var/log/messages and /usr/local/psa/var/log/maillog for possible start up errors:
 
cat /var/log/messages
cat /usr/local/psa/var/log/maillog

If after attempting to restart the service you are still encountering a connection refused error message, try to run courier-imap with the default configuration. To do this, backup the original configuration files:
  • /etc/courier-imap/pop3d for POP3
  • /etc/courier-imap/imapd for IMAP
Replace these with the default distribution configuration files:
  • /etc/courier-imap/pop3d.dist for POP3
  • /etc/courier-imap/imapd.dist for IMAP
Now, restart courier-imap and try to login again. In case of success, compare the original and *.dist files in order to find the option that may have caused the problem.

No comments:

Post a Comment