Pass Macros with Milter.macros

Individual sendmail macros may be sent to your Milter during nearly any phase of the SMTP transaction. Table 26-7 shows the individual options available for sending macros.

Table 26-7. Options to have sendmail macro values sent to a Milter

mc option

Configuration option

§

confMILTER_MACROS_CONNECT

Milter.macros.connect

Milter.macros.connect on page 1054

confMILTER_MACROS_ENVFROM

Milter.macros.envfrom

Milter.macros.envfrom on page 1054

confMILTER_MACROS_ENVRCPT

Milter.macros.envrcpt

Milter.macros.envrcpt on page 1055

confMILTER_MACROS_DATA

Milter.macros.data

Milter.macros.data on page 1055

confMILTER_MACROS_EOH

Milter.macros.eoh

Milter.macros.eoh on page 1056

confMILTER_MACROS_EOM

Milter.macros.eom

Milter.macros.eom on page 1056

confMILTER_MACROS_HELO

Milter.macros.helo

Milter.macros.helo on page 1054

Two steps are required for you to set up a macro for use with your Milter. First you declare your intention inside your mc (or configuration) file with a line like the following:

define(`confMILTER_MACROS_HELO',``{client_addr}, {client_name}'')

This tells sendmail you want the value of the ${client_addr} macro (${client_addr} on page 810) and the value of the ${client_name} macro (${client_name} on page 812) sent to the xxfi_helo() handler function (Milter xxfi_helo() on page 1218) inside your Milter.

Second, you arrange inside your Milter for your handler function (here your xxfi_helo() handler) to receive (request) those macro values ...

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.