Installing IMAP server on Solaris 10

I run my own mail server at work for largely one reason – no restriction on the mail storage space. Our Corporate IT sets a limit on ~ 2-year worth of emails archive you’re allowed to keep and some set number of GB’s you are allocated. This is simply not enough for me. Having worked at Sun for 12 years, I have had emails all the way back to ’95. Occasionally, I went back to find an old email and surprised my colleagues how “deep” of a memory I had. In order to do this (probably due to my hoarding and/or control instinct), I must have my own mail server. Good thing is that Solaris is pretty good at relaying emails. I only have to worry about servicing the IMAP clients – my laptop, my PC at home and etc.

Here are what I do (regularly, due to frequent change of servers) to set up an IMAP server on my work server running Solaris 10:

1) Download and install the University of Washing IMAP server package from sunfreeware.com.
2) Download and install the opensll package sunfreeware.com.
3) In order to run secure SSL socket, you’d need to create an self-assigned SSL certificate:
> /usr/local/ssl/bin/openssl req -new -x509 -nodes -out imapd.pem -keyout imapd.pem -days 3650
4) cp imapd.pem /usr/local/ssl/certs
5) To add to svc servces, so the port 993 gets used for imaps:
edit /etc/services add the following line in addition to “imap 143/tcp”:
imaps 993/tcp
6) Due to the new Solaris SMF (Service Management Facilities), you’ll need to have IMAP added to the service. The easiest way to do this without constructing an esoteric svc manifest file, is to edit /etc/inet.conf and add the following line:
imaps stream tcp nowait root /usr/local/sbin/imapd imapd
7) Run the following command to convert to manifest file (/var/svc/manifest/network/imaps-tcp.xml):
inetconv
8 ) Start the svc by running the following command:
svcadm enable /network/imaps/tcp

Done. Not too bad but wouldn’t it be nice if the installation takes care of all these steps in one shot?