Configuring IMAP and POP3
Previous  Top  Next

What now? Are we done? Are we finally getting near Florida? Almost. Those two daemons will be invoked by the service xinetd so we have to tell xinetd where to find them and how to start them. But first we make sure the both services are registered in the /etc/services file by typing

cat /etc/services | grep pop3
cat /etc/services | grep imap

this should result in lines like this ones (unimportant ones omitted)
pop3
110/tcp
pop-3
# POP version 3
imap2
143/tcp
imap
# Interim Mail Access Proto v2

                     
If you don't see those lines, please add them with vi /etc/services. Xinetd loads all daemons which are properly configured in the directory /etc/xinetd.d/. Since neither pop3 nor imap are configured there, we will have to create 2 files. Lets create ourselves a template by copying the configuration of telnet and editing it

cp /etc/xinetd.d/telnet /etc/xinetd.d/pop3
vi /etc/xinetd.d/pop3

Then edit the file /etc/xinetd.d/pop3 so it will look like this:

# default: on
# description: The pop3 server serves pop3 connections; it uses
# unencrypted username/password pairs for authentication
#
service pop3
{

socket_type
= stream

wait
= no

user
= root

server
= /usr/sbin/ipop3d

}
log_on_failure
+= USERID

Then we do the same for imap

cp /etc/xinetd.d/pop3 /etc/xinetd.d/imap
vi /etc/xinetd.d/imap

And the file should look like this

# default: on
# description: The pop3 server serves pop3 connections; it uses
# unencrypted username/password pairs for authentication
#
service imap2
{

socket_type
= stream

wait
= no

user
= root

server
= /usr/sbin/imapd

log_on_failure
+= USERID
}



You should be careful and make sure that the name that's listed next to service is the one you found / entered in the file /etc/services. Once the configuration files exist we can restart xinetd and see if we can use those services. We simply type

/etc/rc.d/init.d/xinetd restart

and see what happens.