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, and 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.

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.