Flux rss

Intranet - Installing a mail server

 

Introduction to installation

The most commonly used e-mail server in Linux is Sendmail; however, as it is very hard to configure, we will use Qmail, an alternative e-mail server, instead.

Qmail is made up of a group of programs that work with different UID/GIDs, in order to minimise intrusions.

Packages needed for installation

In order to install Qmail, the following packages are required:

  • functions-2-1.i386.rpm
  • daemontools-0.53-16-i386.rpm
  • ucspi-tcp-0.84-1.i386.rpm
  • qmail-1.03-14ucspi.i386.rpm
  • checkpassword-0.81-2.i386.rpm

They may be downloaded from the website RPMFind.net.

Installing Qmail

To install Qmail, you must first install all these RPM packages:

rpm -ivh functions-2-1.i386.rpm
rpm -ivh daemontools-0.53-16-i386.rpm
rpm -ivh ucspi-tcp-0.84-1.i386.rpm
rpm -ivh qmail-1.03-14ucspi.i386.rpm
rpm -ivh checkpassword-0.81-2.i386.rpm
Once these packages are installed, configuration files are created, as well as two user groups, seven new users, and the following directories:
  • /var/qmail: main directory
  • \_ alias/: for storing "special" accounts (like root)
  • \_ bin/: Qmail distribution binaires
  • \_ control/: configuration files
  • \_ defaultdelivery/: configuration files for mailbox formatting
  • \_ man/: pages in the manual
  • \_ doc/: documentation
  • \_ queue/: the queue file
  • \_ users/: address map (super-file of aliases)
The Qmail documentation is found in the directory /var/qmail/doc. To be able to use the pages in the Qmail manual, you have to manually add the path to them in the MANPATH variables using the following syntax:
export MANPATH=$MANPATH:/var/qmail/man

Redirecting the superuser's mail

With Qmail, for security reasons, the superuser (or root) cannot receive mail directly. His/her email must therefore be redirected to a special account, by editing the file .qmail-root (all files whose name begins with a full stop are hidden files) located in the directory /var/qmail/alias:

cd /var/qmail/alias
cat > .qmail-root
your_user_account
^D
It is also possible to redirect mail for other users.

Choosing the mailbox format

With Qmail, you can choose a mailbox format, meaning the way that users' messages are stored. The format "Maildir" is used for storing users' messages directly into their work directory (hence the reason for creating Maildir in the skeleton).

Thus, in order to use this mailbox format, you must enter the following commands:

cd /var/defaultdelivery
cp -f mdir rc

Configuring Qmail

In order to be able to use Qmail, it still has to be configured, particularly the control files found in the directory /var/qmail/control :

  • me
    contains the name of the email server
  • defaultdomain
    contains the default domain name
  • locals
    contains all names/aliases on the mail server
  • rcpthosts
    contains the name of the domains authorised to use the mail server to send email
Here are the commands to enter to configure these files:
  • cd /var/qmail/control
  • cat > me
    tuxserver
    ^D
  • cat > me
    tuxserver
    ^D
  • cat > defaultdomain
    tuxdomain
    ^D
  • cat > locals
    tuxserver
    tuxserver.tuxdomain
    smtp
    smtp.tuxdomain
    ^D
  • cat > rcpthosts
    tuxdomain
    .tuxdomain
    ^D
The basic configuration of the server is finished, and now the mail server can be launched.

Launching services

The following commands are used to manually launch the services required by the email server:

/etc/rc.d/init.d/qmail.init start 
/etc/rc.d/init.d/qmail-smtpd.init start
/etc/rc.d/init.d/qmail-pop3d.init start
Here are the commands for automatically starting (and ending) these services each time the system reboots:
chkconfig --level 345 qmail on 
chkconfig --level 345 qmail-smtpd on
chkconfig --level 345 qmail-pop3d on
chkconfig --level 0126 qmail off
hkconfig --level 0126 qmail-smtpd off
chkconfig --level 0126 qmail-pop3d off

Michel Maudet

Last update on Thursday October 16, 2008 02:43:14 PM.

This document entitled « Intranet - Installing a mail server » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
Install FreeNX server Install FreeNX server Instruction for installation Clients NX NX is a system that enables you to access your desktop from another computer over the internet. There exist different types of NX server: NX Server and 2X for... en.kioskea.net/faq/sujet-722-install-freenx-server
MAIL SERVER ISSUES hello I have a 2003sp2 domain controller (one network card) .I use is as my mail server with microsoft exchange 2003 sp2 and webserver.I dont have a static address so I use No-ip service to map my dynamic ip.I live in Canada so I have rogers and on... en.kioskea.net/forum/affich-38091-mail-server-issues
Windows mail error Hello, I've set up windows mail on my Vista laptop to look exactly the same as my XP desktop in the General tab, the server information and the incoming mail server but I'm getting a server error 0x800CCC90 and 0x800CCC92 error. I've... en.kioskea.net/forum/affich-14812-windows-mail-error
[Ubuntu]Installing an HTTP proxy server (Squid)Installing an HTTP proxy server (Squid) 1.Installing the proxy 2.Configuring the proxy 2.1.Naming the proxy 2.2 Choosing the Port 2.3.Choosing the interface 2.4. Setting access rights and priorities 2.5. Authorizing access to group 2.6.... en.kioskea.net/faq/sujet-804-ubuntu-installing-an-http-proxy-server-squid
Detecting server name for Ingres installationDetecting server name for Ingres installation Ingres can be installed several times on a single machine and depending on configurations, it can bring a bit of confusion (even if a basis exists in these environments). The installation of... en.kioskea.net/faq/sujet-883-detecting-server-name-for-ingres-installation
[Linux]Having a daily report of servers by mail[Linux]Having a daily report of servers by mail The monitoring and administration of Linux systems is a very difficult task when there is large number of interconnected servers, system resources and updates to each of them it,must... en.kioskea.net/faq/sujet-789-linux-having-a-daily-report-of-servers-by-mail
Downgrade Win 2008 Server to 2003 ServerHello, I am trying to install W2003 Server. I am told that MS no longer do 2003 Server licences, and that now the only way of getting a licensed W2003 Server installation is to use 2008 server media. I've been given a legitimate licensed 2008... en.kioskea.net/forum/affich-1819-downgrade-win-2008-server-to-2003-server
SQL Server 2005 intallation problem to VistaHello, I have installed SQL Server 2005 in my system, but I still have problem to in using it. I heard there is problems of installation of SQL in Vista, can somebody help me with ideas please en.kioskea.net/forum/affich-19008-sql-server-2005-intallation-problem-to-vista
Sending mailHello, Can anybody help me I am sending mail to gmail and other mail server by using php mail method but when I send through local system then it work properly but online it does not work Please tell me what is the reason thanks in advance en.kioskea.net/forum/affich-25541-sending-mail
Download PopcornPopcorn is a ultra-lightweight POP3/SMTP e-mail client.It will work as a client/server application, reading mail "directly" from POP3 servers. Popcorn requires no installation, no data is saved locally other than a portable .INI file containing... en.kioskea.net/telecharger/telecharger-229-popcorn
Intranet - Installing a DNS A DNS (domain name server) is a server that links names to the IP addresses of computers on a network. In order to set up such a server, it is necessary to install bind and named. They can be downloaded as RPM files (for Mandrake they are bind... en.kioskea.net/intranet/resdns.php3
Intranet - Installing the Linux distribution Mandrake The server can work with any Linux distribution, but we have chosen to use the distribution Mandrake, which has the advantage of being simple to install, and includes a multitude of pre-installed applications. You can find this distribution: On the... en.kioskea.net/intranet/resinst.php3
Réseaux - Intranet and extranet An intranet is a set of Internet services (for example a web server) inside a local network, i.e. only accessible from workstations of a local network, or rather a set of well-defined networks that are invisible (or inaccessible) from the outside. It... en.kioskea.net/entreprise/intranet.php3