Installing Couriersite

The installer assumes that you are installing on a "clean" system. It's fine if courier is already installed, but the install script will install all the courier pieces for you if they are not already present. You probably shouldn't install this on a system where you already have a working courier setup. The install script will try NOT to overwrite any of your settings, but there are some things that need to be set for this system to work, but which might make your system STOP working. So test it out ahead of time on a development system before you try to massage it to make it work on your existing setup.

The installation script is also only for debian-based systems. We run this on Debian Lenny and Ubuntu Hardy, so we know everything installs and runs cleanly on those systems. But it should work fine on any recent debian or debian-based distro. If you are running an rpm-based distro, however, then all the "apt-get" commands are going to fail spectacularly. :-) The Couriersite program may run fine once you get it installed and edit the configuration file to tell it how your system is set up. But I can't guarantee anything other than debian and ubuntu since that's what we are running. So, as always, YMMV.

Finally, the installer expects apache to be installed and checks for the config directory. So you'll need to install it before you run this install script. If you are using a web server other than apache, then you'll need to edit the "INSTALL.pl" script to manually set the web server user and group as well as comment out the check for the apache configuration directory.

OK, the disclaimers out of the way, let's get to installing. It's done simply from a script on the command line. So download the proper tar ball for your machine type (32 or 64 bit) from here and extract the files to your server. Then fire up a terminal and navigate to where ever you extracted the files.

First take a look at the "INSTALL.pl" file itself. There are four variables near the top:my $install_spamassassin = 1;
my $install_clamav = 1;
my $install_mailinglist_manager = 1;
my $install_calendar_support = 1;

If you do NOT want to install spamassassin, clamav, the mailinglist manager, or shared calendaring support, then simply change that particular variable to a 0. If you later change your mind and want to install that piece, then simply run the installer again with that variable set back to 1. You can run the installer as many times as you want without altering anything (unless you have edited some of the config files by hand, of course, in which case you may need to edit them again).

Then look at the configuration file, "couriersite.conf". At the top are variables which affect how to program runs. You should look at them when you have a chance. But for now scroll down to where it says###INSTALLATION VARIABLESYou should set these three variables - the location of the mailboxes, the mailinglists, and the shared calendars - to where ever you want these to be stored. The directories you specify will be created by the installation. If you decide later that you want to change them, then you can in fact manually move these directories to another location and change the appropriate variable in the configuration file to point to the new location. (Once installed, the configuration file will be "/etc/courier/couriersite.conf".)

Once you've edited those two files, you are ready to install. Simply runperl ./INSTALL.plfrom inside the extracted directory and everything will be set up for you. You'll need to be root, however, to install Couriersite, so either become root before you run that command or preface it with "sudo" if that is set up on your system.

During the process, you'll be asked to confirm the "apt-get install" commands. And if courier itself is being installed by the program, it will ask you about "creating directories for web-based administration." Choose YES. (Although the installer will create these directories for you if you already installed courier and said NO.)

The last step is to take the "apache.conf" file that the installer will create there in the extracted directory and copy it into your web server. Since email administration is sensitive information, I would only run couriersite over HTTPS and never over plain HTTP. (But it's your choice, of course.) So edit your apache HTTPS configuration file and add the 'apache.conf' lines to it. If you want to use shared calendaring, you'll also need to enable the webdav and rewrite modules in apache.a2enmode dav_fs
a2enmod rewrite

Once that's done, you should restart apache and then surf to "/couriersite" on your server. If all has gone well, you should see the Login screen. Enter the password which the installer showed you at the end (you can find it in "/etc/courier/webadmin/password") and you should see all the options.

First thing, go to the "General" page and enter in the name and default domain for this server. Then work your way down the "Settings" pages to configure the various email services that you want to provide. The SMTP page is particularly important since you'll probably want to enable SMTP Authentication, turn on virus scanning (if you installed it), set up blacklists, etc. Once these settings are entered, you probably won't need to adjust them very often. After you've done that, you can go to the Administration page and create new domains, new users, aliases, etc., etc.

You can check out the other programs at "/couriersite/domainadmin.cgi", "/couriersite/listadmin.cgi", and "/couriersite/useradmin.cgi". (If you have enabled mod rewrite in your apache server, then you can get the four programs at their aliases as well - "/siteadmin", "/domainadmin", "/listadmin", and "/useradmin".)

Final Notes

Installing courier-imap also installs the "fam" daemon, which in turn installs "portmap". If you wish to use fam (it is necessary for some extended IMAP functions), then you should secure portmap. Unless you know you need it for external services (like NFS), I would go to "/etc/default/portmap" and enable the option to ONLY allow portmap on localhost. You can also use "host.allow" and "hosts.deny" and/or a firewall to secure the service. If you don't want to provide the extended IMAP commands (we don't), simply remove fam and portmap by running apt-get remove fam portmap

If you installed spamassassin then it will install ALL SORTS of other files, including the gcc compiler. I do not want tools like compilers on servers which face the internet, so I remove these. apt-get remove gcc cpp

If you installed clamav, then courier-pythonfilter was also installed to provide the filtering mechanism. There are MANY different filters you can run from pythonfilter, not just clamav. Read the configuration file, "/etc/pythonfilter.conf" to see all your options. You'll have to manually enter any other filters you want run into this file, but couriersite won't overwrite anything you put in there.

If you do NOT install the shared calendar support and then go back and install it later, there are more configuration lines that need to be added to your Apache setup. So check the "apache.conf" file that gets created by the installer. You'll see there's a new section at the bottom called "couriersite calendar sharing rules". Add those lines to the same place you put your "couriersite web program" rules.

If you haven't already, you should consider joining the Courier User's Mailinglist at Sourceforge. Send a message to courier-users-subscribe@lists.sourceforge.net to subscribe. It's far-and-away one of the most helpful mailing lists I've ever been on.

Finally if you have problems with Couriersite, feel free to write us at "couriersite AT kkoncepts.net". We wrote couriersite to make our lives easier, and we use it every day. We'll be happy to help you as best we can.