How to enable IMAP and POP3 on Solaris 10

In Solaris 10 internet service management using inetd is deprecated. Instead, you should use the System Managemen Facility. This uses an XML descriptor to describe how to start a service, how to stop it and how to restart it if it fails. Rather than writing the descriptor from scratch, Solaris provides a tool to migrate typical inetd.conf entries to the new XML format.

I used this to make the provided pop3d and inetd daemons be SMF complient.

I created a new file & added the two lines which I would have used to start the services if Solaris still used inetd.

cd /tmp
echo "pop3 stream tcp nowait root /usr/sfw/sbin/tcpd /opt/sfw/sbin/ipop3d" > imapd.txt
echo "imap stream tcp nowait root /usr/sfw/sbin/tcpd /opt/sfw/sbin/imapd" >> imapd.txt

/usr/sbin/inetconv -i /tmp/imapd.txt -o /tmp/
cp pop3-tcp.xml /var/svc/manifest/network/
cp imap-tcp.xml /var/svc/manifest/network/

svccfg import /var/svc/manifest/network/pop3-tcp.xml
svccfg import /var/svc/manifest/network/imap-tcp.xml

svcadm disable svc:/network/pop3/tcp:default
svcadm enable svc:/network/pop3/tcp:default
svcadm disable svc:/network/imap/tcp:default
svcadm enable svc:/network/imap/tcp:default

Lets try it and see if it works

bash-3.00# telnet localhost pop3
Trying ::1...
telnet: connect to address ::1: Connection refused
Connected to localhost.
Escape character is '^]'.
+OK POP3 localhost v2003.83 server ready

Yus, seems to be OK...