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


sendmail

sendmailSearch this book
Previous: 30.2 The Symbolic Name Chapter 30
Delivery Agents
Next: 30.4 The Equates
 

30.3 m4 Configuration Syntax

Under V8 sendmail 's m4 configuration technique you include delivery agent definitions in your configuration file with the MAILER() m4 command. The form for that command looks like this:

MAILER(`

name

')

For example, SMTP and UUCP support can be included in your file by using the following two commands:

MAILER(`smtp')
MAILER(`uucp')

The delivery agent M definitions that correspond to MAILER() commands are kept in the _CF_DIR_/mailer directory ( _CF_DIR_ is described in Section 19.2.1, "Maintain local files with _CF_DIR_" ). See Table 19.3 in Section 20.3.2, define() for a list of all the available agents.

In general, the files in the _CF_DIR_/mailer directory should never be modified. If one of the definitions needs to be tuned, use the special keywords described under the individual equates (see Section 30.4, "The Equates" ). For example, the following modifies the maximum message size (the M= equate see Section 30.4.7, M= ) for the UUCP agent:

define(`UUCP_MAX_SIZE',`1000000')dnl

Here, the maximum size of a UUCP message has been increased from the default of 100,000 (one hundred thousand) bytes to a larger limit of 1,000,000 (one million) bytes.

30.3.1 Tuning Without an Appropriate Keyword

Unfortunately, not all equates can be tuned with m4 defines. The U= equate for the usenet agent is one example. To change such a value, you need to copy the original definition, modify it, and put the modified definition in your local mc file. For example, to add a U= equate to the Usenet delivery agent, you might do the following: [2]

[2] We are fudging here. The grep (1) won't work because the Musenet definition is split over three lines. Instead, you need to use your editor to cut and paste.

% 

grep -h Musenet mailer/*


Musenet,    P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,
            _OPTINS(`USENET_MAILER_MAX', `M=', `, ')T=X-Usenet/X-Usenet/X-Unix,
            A=USENET_MAILER_ARGS $u

Here, the prototype definition for the usenet delivery agent is found. Copy that definition into your mc file and add the missing equate:

MAILER(usenet)dnl
MAILER_DEFINITIONS
Musenet,   P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20, 

U=news:news

,
            _OPTINS(`USENET_MAILER_MAX', `M=', `, ')T=X-Usenet/X-Usenet/X-Unix,
            A=USENET_MAILER_ARGS $u

First, the MAILER() m4 command causes initial support for the usenet delivery agent to be included. The MAILER_DEFINITIONS section (see Section 19.6.40, MAILER-DEFINITIONS ) then introduces your new delivery agent definition. Your new definition follows, and thus replaces, the original definition.

Create a new configuration file, and run grep (1) to check the result:

% 

m4 our.mc > our.cf


% 

grep ^Musenet our.cf


Musenet,        P=/usr/lib/news/inews, F=rlsDFMmn, S=10, R=20,
Musenet,        P=/usr/lib/news/inews, F=rlsDFMmn, S=10, R=20, U=news:news,

30.3.2 Create a New m4 Delivery Agent

From time to time you may need to create a brand-new delivery agent. To create a new delivery agent with the m4 system, first change to the cf/mailer directory. Copy an existing m4 file, one that is similar to your needs. Then edit that new file, and include it in your configuration file with

MAILER(newname)

Note that the MAILER m4 command automatically prefixes the name with _CF_DIR_/mailer/ ( _CF_DIR_ is described in Section 19.2.1 ) and adds the suffix .m4 , here forming cf/mailer/newname.m4 .

But be aware that creation of a new delivery agent is not for the faint of heart. In addition to the delivery agent definition you will also need to create brand new S= and R= rules and rule sets.