Adding the review of Qmail this week prompted me to write this installation and setup guide for first-time users
of Qmail. Just a quick thanks to Tony Wade for the help he gave me with
Create the directory /var/qmail or edit conf-qmail in your source directory to set your own
2. Setup the Qmail users and group.
Enter the following at command prompt ( without the "'s )
( add's a new group called nofiles )
"useradd -g nofiles -d /var/qmail/alias alias"
"useradd -g qmail -d /var/qmail qmailq"
3. Installing Qmail.
Make sure you are in the install directory and type
4. Pre-configuring Qmail.
If you have DNS setup on your system run the following command in your install directory.
( please note: replace "your.host.name" with your acuall hostname )
You need to create some aliases for qmail to use. Type the following command.
"chmod 644 ~alias/.qmail*"
This is a very important step. Please follow the instructions very carefully.
Read the following files that is in your install directory.
I would suggest using the Maildir system, as it is easy to setup. Unfortunately if you choose the Mbox system you'll have to consult the documentation for installation instructions.
To use the Maildir option, run the following commands.
If you have sendmail on your system, I would suggest removing it. To find out if you have sendmail follow these steps.
On RedHat and other RPM based systems:
Type in at your command prompt:
On other systems using tar.gz format:
Follow these steps.
Type in at your command prompt
"rm -f /usr/sbin/sendmail"
9. Linking Sendmail to Qmail
"ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail"
10. Adding Qmail to your to /etc/inetd.conf
Add this string to your /etc/inetd.conf file so that your internet daemon knows what to do with mail. ( do not copy it or it will not work and make sure you put it in the correct place )
pop-3 stream tcp nowait root /var/qmail/bin/qmail-popup qmail-popup your.domain.here /bin/checkpassword /var/qmail/bin/qmail-pop3d ./Maildir/
10. using Qmail with Shadowpasswords.
If you do not know if you are running shadow passwords the do the following.
If you see text where the "x" is then skip this next step.
After downloading checkpassword, type the following:
Once you have removed the content, replace it with this. ( do not copy and paste. It does not work )
# If using RehHat 5, uncomment the next line
# Additionally for shadow passwords under Linux RehHat 5, uncomment
$(LD) -o checkpassword checkpassword.o $(SHADOWLIBS) $(CRYPTLIB)
$(CC) -c checkpassword.c
shar -m `cat FILES` > checkpassword.shar
"cp ./checkpassword /bin"
Edit /etc/rc.d/rc.local and add these line to the file:
echo "Starting Qmail Mail Server"
There are some final pointer to keep in mind. 1. It's easer to setup qmail before adding user since it will effect their directories.
If you already have users on the system and you are using the maildir system for mail delivery you'll have to do some more work quickly.
In each users directory you have to run these commands:
Now you have to change the permissions so that the user can see the directory.
( this had me boggled for a few minutes. )
"chmod -R gu+rw /home/
I suggest you read ALL the Installation documentation in /var/qmail/doc/ This will give you information on how to optimize and change settings for Qmail.