Tutorial:Hardware
How To Set Up A
Linux Mail Hub
A mail hub is a machine that sits on your LAN, acting as the interface between your users and the
Internet. It processes all mail, ensuring that messages sent from users get transmitted and that
incoming items are distributed to the correct user. Linux, the free version of Unix, allows you to
set up a Unix based mail hub on an old Intel box for minimum outlay and maximum flexibility.
By Paul Dunne
I
n this article, we will cover setting
Configuring
figuration files themselves. They have
up a Linux machine to act as a mail
.mc suffixes, and must be run through
hub for the local network, allowing
Tackling the sendmail configura
M4 to become complete. The resulting
workstations to send and receive In
tion process from scratch is tough. The
output should have a .cf suffix.
ternet mail without themselves being
main configuration file, sendmail.cf, is
The /ostype directory contains
directly connected to the outside world.
designed to be easy for the sendmail
definitions describing a particular op
Before you try doing this, you
program to read. Unfortunately, this
erating system type. These should al
should already know how to install
means that it's somewhat cryptic to
ways be referenced using the OSTYPE
Linux and connect that Linux machine
mere humans. Fortunately, it is a task
macro in the .mc file.
to the Internet. [If you don't, we'll be
that rarely has to be done from the
The /domain directory contains
covering it in a future issue of PCNA Ed.]
beginning. The sendmail distribution
definitions describing a particular do
includes several sample sendmail.cf
main, referenced using the DOMAIN
Sendmail
files, one or other of which can be
macro in the .mc file. The /mailer di
adapted to most configurations with a
rectory holds descriptions of mailers,
Although the sendmail utility comes
few changes. Any modern Linux dis
referenced using the MAILER macro
ready built with almost any Linux dis
tribution will include these sample
in the .mc file.
tribution you care to name, there are
files in its sendmail installation.
In the /sh directory are the shell
advantages to knowing how to com
Recent versions of sendmail have
files used when building the .cf file
pile it yourself. Firstly, a widely used,
introduced an important simplifica
from the .mc file in the cf subdirectory,
important program such as sendmail
tion into the configuration process, by
while /feature holds special features
inevitably attracts a lot of attention from
shifting the user intervention from di
that you might want to include. They
hackers. Updates to the program incor
rect editing of the sendmail configura
should be referenced using the FEA
porating fixes for the latest security
tion file to making changes to files of
TURE macro.
holes are regularly being made avail
M4 macros, which is easier and more
In /hack you'll find local hacks
able. These updates are available as
immediately understandable.
from Berkeley (the home of sendmail),
patches against the source code, which
In this section, we will consider use
of no more than voyeuristic interest, if
you need to add and then re compile.
of the M4 macros. The section on con
that. And in /siteconfig is the site con
(You can get sendmail precompiled, of
figuring a sendmail client that con
figuration, ie, tables of locally con
course, but it's safer to compile your
nects to our mail hub will deal directly
nected UUCP sites.
own from source code that doesn't ap
with the /etc/sendmail.cf file, as that
pear to have been hacked.)
process is sufficiently simple to be eas
Typical File
There is a sendmail Web page at
ily accomplished without the aid of the
www.sendmail.org, and many sitesmir
M4 macros.
The root of the configuration proc
ror the source code from there. Once
ess is what might be called the base .mc
you have the source, extract it into a
Generating A Config
file. This forms the starting point for
directory (/usr/src/sendmailx.x.xx)
M4 directives which invoke other
and cd into the src directory therein. In
The sendmail configuration appa
macro files. All of the definitions in our
there is a makesendmail shell script that
ratus is in the /cf subdirectory. Within
base .mc file in turn reference other .mc
will do all the work for you. It is easiest
this, the /m4 directory contains sup
files. Order is important: follow that
to do the configuration in the source
port routines, which should not be
given here.
directory, before actually installing the
changed.
In what follows, I shall simply clar
binary and configuration files.
The /cf directory contains the con
ify what I have done here. For the full
Issue 89 (November 1997) page 15
File: T1402.1
PC Network Advisor
Next page >
New! The best sites for quality inkjet printer cartridges and the best sites for cheap inkjet cartridges