Create a New mc Delivery Agent

From time to time you might need to create a brand-new delivery agent. To create a new delivery agent with the mc 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 mc configuration command automatically prefixes the name with the following (where _CF_DIR_ is described in The _CF_DIR_ m4 Macro on page 588):

_CF_DIR_/mailer/

and adds the suffix .m4, here forming cf/mailer/newname.m4.

Be aware, however, that creation of a new delivery agent is not for the fainthearted. In addition to the delivery agent definition, you might also need to create brand-new S= and R= rules and rule sets.

MAILER_DEFINITIONS

Prior to V8.8 sendmail, you had to use a divert(7) statement to force your new delivery agent definitions to be grouped with all the other delivery agent definitions. Beginning with V8.8, this bit of “black magic” has been removed.

To force new delivery agent definitions to be grouped with the other delivery agent definitions, use the MAILER_DEFINITIONS m4 command. For example:

MAILER_DEFINITIONS
place your new delivery agent definitions here

See Tuning Without an Appropriate Keyword on page 715 for an example of this m4 command.

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.