Setting Up and Configuring a POP3 server

Setting Up and Configuring a POP3 server

There are many options for a POP3 server, but I have had a great deal of luck and good service with qpopper from Qualcom, the folks who make Eudora. I based this guide on the latest version of qpopper available at the time of writing, which is 4.0.8 which means the file name that we download will be called qpopper4.0.8.tar. There may be a newer release out there by the time you are reading this (visit their site to check). If so and you want to use that, these notes should still work, but you should read the docs to make sure nothing changed.

Unpack, configure, compile and install the software

Go to the directory where you downloaded the qpopper tar file. Once there, unpack the archive like this:
tar -xvf qpopper4.0.8.tar

Next, change into that directory:
cd qpopper4.0.8

Inside this directory you will find a file called GUIDE.pdf that has loads of good documentation on configuring, compiling and setting up qpopper, it’s a good read. Below I will go through some basic steps to build it the way I use it, which has worked well for me and should work for anyone.

Before we do anything else, we have to configure the software, meaning we run a script to create the makefile. It will also check the system for things that it needs to build and run the software. Here is the command I use, with the options I want configured with the software and is run while in the directory created when we extracted the file we downloaded. Please note that each option starts with two dashes, it sometimes doesn’t display right in a web browser:

./configure --enable-specialauth --enable-shy --enable-log-login --enable-servermode --enable-standalone

Please note the command is rather long and wraps to the second line, it’s one line and not two. You can look in the GUIDE.pdf for more details on what these options do, but a quick summary is:

--enable-specialauth - this allows qpopper to authenticate using the shadow file, meaning local user accounts
--enable-shy - this disables version info in the protocol banner, a good security measure
--enable-log-login - qpopper logs successful logins
--enable-servermode - this enables server mode by default
--enable-standalone - run a standalone deamon and not one under inetd/xinetd

Once the configure command has been run, we make and then make install:
make
make install

One thing to note, I have run into a weird problem on some systems where the make install would fail because the directory /usr/local/man/man8 did not exist. In this case I simply created that directory (mkdir -p /usr/local/man/man8), and ran make install again.

Create startup/shutdown scripts

Now that we have qpopper installed, we need some scripts to start it when the server starts, and to stop it when the server shuts down. I normally create a script called “qpopperd” that I place into /etc/init.d with the rest of the startup/shutdown scripts that will do just that. The script won’t read very well posted in this article, so I posted it in the forums where our other scripts live. You can take a look at it there.

Once you have your script, whether you use the one I provide or one you wrote, put the qpopperd script into /etc/init.d with the rest of the startup and shutdown scripts. Then use chkconfig to enable the script, this assumes that the script has the appropriate lines in it to be compatible with chkconfig. If you look at the appropriate lines in the script, we have it start in runlevels 3 and 5 with s start priority of 56 and a stop of 36. If you need some information on chkconfig and Linux, go here to see the article on chkconfig.

It’s important to note here, that although this may not be as critical as it once was, I have had problems starting sendmail before qpopper in the past. So I make sure that qpopper starts before sendmail and stops after sendmail, hence the priorities I have chosen.

After the qpopperd script is in /etc/init.d, set the proper permissions:
chown root.root qpopperd
chmod 755 qpopperd

Run the chkconfig command to get it set in the runlevels (as above, two dashes before add):
chkconfig --add qpopperd

Run chkconfig again with the list option to make sure it is correct (and again, two dashes before list):
chkconfig --list qpopperd

And you should get this back:
qpopperd 0:off 1:off 2:off 3:on 4:off 5:on 6:off

Testing

While in /etc/init.d, start the qpopper deamon like so:
./qpopperd start

And you should get this back, please note that the [PID] will be different:
Starting QPopper [2469]: [ OK ]

You can double check that it is running with the ps command:
[root@yuri init.d]# ps -ef | grep popper
root 2469 1 0 11:45 ? 00:00:00 /usr/local/sbin/popper

There you go, grab a mail client and check it out!

One thought on “Setting Up and Configuring a POP3 server

  1. Pingback: Setting Up and Configuring a POP3 server | Solarum - Information For Everyone

Tell me what you are thinking?