O'Reilly logo

Sendmail, 3rd Edition by Bryan Costales

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Processing the Command Line

The sendmail program’s ability to perform different tasks necessitates that the command line be processed in steps.

First

The command line is prescanned to set its -d debugging switch. That switch allows you to watch all the steps taken by sendmail prior to processing the rest of the command-line switches.

Second

Internal sendmail macros are given their starting values, then the command line’s argv[0] (the name used to run sendmail) is processed. That name can determine the sendmail program’s mode of operation.

Third

The command-line switches are processed. Although the configuration file is read after the command line is processed, options in the command line (with -o and -O) still supersede those in the configuration file.

Fourth

The configuration file is read.

Fifth

If sendmail is running in a mode that allows it to verify or deliver to recipients, the remainder of the command line is processed to extract the recipient list.

First: Prescanning the Command Line

When sendmail begins to run, it performs a preliminary scan of its command-line arguments. It does this because some actions need to be performed before the configuration file is read. The -d command-line switch is processed during the prescanning phase.

Second: Processing Prior to the Switches

After the command-line switches are prescanned, but before they are processed in full, sendmail performs two important internal tasks.

Initialize the environment

The environment variables that are given to sendmail ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required