Networking / Beginners


E-mail has become the easiest and fastest way of communication in modern times. On the Internet, the majority of servers run the UNIX operating system or its derivatives, such as BSD, Linux, and SunOS. Sendmail is the program most of these systems use to handle e-mail. To use sendmail, you need to install the sendmail and sendmail-cf packages.

Sendmail is able to route or deliver mail between a mail User Agent (UA) and a Message Transfer Agent (MTA). UA is a program you might use to read and send e-mails. MTA is a program that moves mail between hosts using a particular network protocol or language. Sendmail can be easily configured to accommodate new UAs and MTAs, with only minor configuration changes.

When a sender wants to send a message, it issues a request to sendmail. The sendmail program operates in two distinct phases:

  • In the first phase, It collects messages and stores them as requests from the senders.
  • In the second phase, it delivers the messages to the recipients.

If there are errors during processing in the second phase, sendmail creates and returns a message. This mail provides details of the error that occurred and/or the source of the error. When an error is encountered that can be retried, sendmail places the message in a message queue.When an unrecoverable error is encountered, automatic routing happens and e-mail is sent to the sender.

Configuration Files

The sendmail program uses many configuration files. These files are located in the /etc/mail directory. we will discuss some of these configuration files here:

  • Makefile. This file is used when the make command is run. Running make might cause missing database (.db) files to be created with no entries. The make command creates the database files. The content of Makefile is given here:
    all: virtusertable.db access.db domaintable.db mailertable.db
    %.db : %
    		@makemap hash $@ < $<
    		@rm -f *.db *~
  • helpfile. This is the text file sendmail displays when you issue a HELP command.
  • relay-domains. This file specifies the domains that the computer will relay.
  • This file contains the m4 macro preprocessor program. The m4 program is used by sendmail to produce a sendmail configuration file. When run, this macro program produces the configuration file:
    dnl This is the macro config file used to generate the /etc/
    dnl file. If you modify the file you will have to regenerate the
    dnl /etc/ by running this macro config through the m4
    dnl preprocessor:
    dnl 		m4 /etc/ > /etc/
    dnl You will need to have the sendmail-cf package installed for
    this to dnl work.
    VERSIONID(`linux setup for Red Hat Linux')dnl
    define(`confTO_CONNECT', `1m')dnl
    define(`STATUS_FILE', `/var/log/')dnl
    define(`UUCP_MAILER_MAX', `2000000')dnl
    define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
    dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn')dnl
    dnl define(`confTO_QUEUEWARN', `4h')dnl
    dnl define(`confTO_QUEUERETURN', `5d')dnl
    dnl define(`confQUEUE_LA', `12')dnl
    dnl define(`confREFUSE_LA', `18')dnl
    FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
    FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
    dnl We strongly recommend to comment this one out if you want
    to protect dnl yourself from spam. However, the laptop and users
    on computers that do dnl not have 24x7 DNS do need this.
    dnl FEATURE(`relay_based_on_MX')dnl
  • access. This is the access database. The content of this file is given here:
    # Check the /usr/doc/sendmail-8.11.0/ file for a description
    # of the format of this file. (search for access_db in that file)
    # The /usr/doc/sendmail-8.11.0/ is part of the
    # package.
    # by default we allow relaying from localhost...
    localhost.localdomain 	RELAY
    localhost 		RELAY 		RELAY
  • mailertable. This database will allow you to specify different routes for email. It allows you to specify domain translation or forwarding to a new domain name.
  • virtusertable. This database allows you to rewrite and redirect incoming mail. It maps virtual domains and addresses to new addresses.
  • aliases. This is the master alias database for the machine. It contains mail aliases. These aliases are used by the system to allow mail sent to one address to be redirected to another recipient. Other uses for the aliases are to allow mail to be piped to a program for additional processing.
[Previous] [Contents] [Next]