Next: , Previous: , Up: Pragmatic comments   [Contents][Index]


4.5.6 Pragma miltermacros

pragma: miltermacros handler macro …

Declare that the Milter stage handler uses MTA macro listed as the rest of arguments. The handler argument must be a valid handler name (see Handlers).

Normally, the mailfromd parser collects names of the macros used in each handler and registers them for use by that handler. This includes all ‘$name’ references (see Sendmail Macros) appearing within the handler, in all functions called by that handler, as well as in the prog action hook (see Action Hook), if the handler invokes any Sendmail action explicitly.

In particular, macro names given as arguments to getmacro and macro_defined functions are recognized, as long as these arguments are constant strings, or can be optimized to such. However, if thes arguments are constructed dynamically, mailfromd cannot predict which macros will be needed. In this case, the necessary macros should be declared using #pragma miltermacros.

During initial negotiation with the MTA, mailfromd will ask it to export macro names declared by the procedure described above. The MTA is free to honor or to ignore this request. In particular, Sendmail versions prior to 8.14.0 and Postfix versions prior to 2.5 do not support this feature. If you use one of these, you will need to export the needed macros explicitly in the MTA configuration. For more details, refer to the section in Using mailfromd with Various MTAs corresponding to your MTA type.