home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

P=

Path to the delivery agent All versions

The P= delivery agent equate specifies the full pathname of the program that will act as the delivery agent. The form for the P= delivery agent equate looks like this:

P=path

If path is missing, sendmail will print the following error message and set P= to NULL:

mailer agent_name: empty pathname

The path can also be one of three names that are defined internally to sendmail. Those internally defined names are [IPC], which tells sendmail to forward mail over a kernel-supported (usually TCP/IP) network; [FILE], which tells sendmail to deliver to a file; and [LPC], which is used for debugging.

P=path

When the path begins with a slash character (when it is a full pathname), sendmail first forks (creates a copy of itself), and then the child process (the copy) execs (replaces itself with) the program. The argument vector (argv, or command-line arguments) supplied to the program is specified by the A= delivery agent equate (A=). The program inherits the environment[15] of sendmail and has its standard input and output connected to the parent process (the sendmail that forked). The message (header and body) is fed to the program through its standard input. The envelope (sender and recipient addresses) might or might not be provided on the command line, depending on the nature of the program as defined by its F= delivery agent flags. If A= does not include the $u sendmail macro, sendmail will speak SMTP, or LMTP if the delivery agent has the F=z flag set (F=z).

[15] In most versions of sendmail the environment is stripped for security. V8 passes only TZ=, AGENT=, and (beginning with V8.7) the environment variables specified with the E configuration command (Section 10.2.1).

P=[IPC]

The special internal name [IPC] specifies that sendmail is to make a network connection to the recipient host and that it should talk SMTP or LMTP to that host. Beginning with V8.10, sendmail allows [IPC] delivery agents to also connect to Unix domain sockets (See this section). Some current versions of sendmail allow the name [TCP] to be a synonym for [IPC], but [TCP] is deprecated as of V8.10, and removed from V8.12, and should not be used. The $u sendmail macro should never be included in the A= for this internal name.

P=[FILE]

Beginning with V8 sendmail, the internal name [FILE] specifies that delivery will be made by appending the message to a file. This name is intended for use by the *file* delivery agent (*file* and *include*). [FILE] can be useful for designing a custom delivery agent whose purpose is to append to files (perhaps coupled with the U= delivery agent equate, U=, to force particular ownership of the file).

P=[LPC]

The special internal name [LPC] (for local person communication) causes sendmail to run in a sort of debugging mode. In this mode you act as an SMTP server, interacting with the sendmail program's standard input and output.

The [LPC] mode can be very helpful in tracking down mail problems. Consider the mystery of duplicate five-character "From " header lines that appear at the beginning of a mail message when mail is sent with UUCP. To solve the mystery, make a copy of your sendmail.cf file and in that copy change the P= for the UUCP delivery agent to [LPC]:

Muucp, P=/usr/bin/uux, F=msDFMhuU, S=13, R=23, A=uux - -r $h!rmail ($u)
          
 
          change to
          
 
Muucp, P=[LPC], F=msDFMhuU, S=13, R=23, A=uux - -r $h!rmail ($u)

Then run sendmail by hand to see what it is sending to the uux program:

# /usr/lib/sendmail -Ccopy.cf uucpaddress  <  message    

Here, the -Ccopy.cf command-line argument causes sendmail to use the copy of the sendmail.cf file rather than the original. The uucpaddress is the address of a recipient that would normally be sent via UUCP. The message should contain only a Subject: header line and a minimal body:

Subject: test    one-line header
             a blank line
This is a test.  one-line body

If sendmail prints the message with a five-character "From " header line at the top, you know that sendmail is the culprit.

Modify P= using an mc configuration macro

Using V8 sendmail's mc configuration technique the P= delivery agent equate can easily be changed by defining an appropriate mc macro. For example, the following modifies the P= for the procmail delivery agent:

define(`PROCMAIL_MAILER_PATH', `/usr/local/bin/procmail') this must be
MAILER(`procmail')                                        before this

See the section describing a particular delivery agent to find an appropriate mc macro with which to redefine the P= for that delivery agent. See Table 20-1, in Section 20.4, for a guide to all delivery agents.

In general, the default values given to these are automatically set when you include the appropriate OSTYPE( ) directive (Section 4.2.2.1).

    Previous Section Next Section