General-Purpose Mail Filter
MeTA1’s notion of macros differs considerably from that of Sendmail.
Macros in MeTA1 are identified by integer numbers and only a limited
number of macros can be provided for each Pmilter stage.
Pmilter stages mostly correspond to Milter states (see handler names), except that there are no distinct header and body stages,
instead these two are combined into a single ‘data’ stage. This
comes unnoticed to mailfromd scripts, because
care to invoke right Milter handlers within the single ‘data’
Pmilter state. Therefore in the discussion that follows we will refer
to Mailfromd handlers, rather than to Pmilter stages.
The most important standard Milter macros are always provided by
pmult itself. These are:
The IP address of the SMTP client. As of version 8.7, only IPv4 addresses are supported. Defined in all handlers.
The port number of the SMTP client. Defined in all handlers.
MeTA1 session ID. Defined in all handlers.
The envelope sender (from) address. Defined in
The number of bad recipients for a single message. Defined in
The number of delivery attempts. As of version 8.7 it is
always ‘1’. Defined in
envfrom and subsequent handlers.
The number of validated recipients for a single message. Defined in
Protocol used to receive the message. The value of this macro is always ‘SMTP’. Defined in all handlers.
The host from the resolved triple of the address given for the SMTP
RCPT command. Defined in
The address part of the resolved triple of the address given for the
SMTP RCPT command. Defined in
Sender’s helo domain (parameter to
Two additional macros are provided for all handlers that allow to
identify whether the message is processed via
Canonical name of the multiplexer program, i.e. ‘pmult’.
These macros can be used in mailfromd filters to provide alternative processing for messages coming from a MeTA1 server.
Macros defined in MeTA1 can be made available in Mailfromd handlers
Define a set of Sendmail macros for the given Mailfromd handler. Allowed values for handler are: ‘connect’, ‘helo’, ‘mail’ (or ‘envfrom’), ‘rcpt’ (or ‘envrcpt’), ‘data’ (or ‘header’ or ‘body’), ‘dot’ (‘eom’). A list of these values is also accepted, in which case macros are defined for each handler from the list.
The second argument specifies a list of names of the macros that should be defined in this handler. Allowed macro names are:
Hostname of SMTP server.
Result of client lookup.
TLS/SSL version used.
TLS cipher suite used.
Effective key length of the symmetric encryption algorithm.
The DN (distinguished name) of the presented certificate.
The DN (distinguished name) of the CA (certificate authority) that signed the presented certificate (the cert issuer).
Maximum key length of the symmetric encryption algorithm. This may be less than the effective key length for export controlled algorithms.
The result of the verification of the presented cert.
The CN (common name) of the presented certificate.
The CN (common name) of the CA that signed the presented certificate.
The mechanism used for SMTP authentication (only set if successful).
The client’s authentication credentials as determined by authentication (only set if successful). The actual format depends on the mechanism used, it might be just ‘user’, or ‘user@realm’, or something similar.
The authorization identity, i.e. the ‘AUTH=’ parameter of the SMTP MAIL command if supplied.
MeTA1 transaction id.
Message-Id of the message.
The hop count. Basically, this is the number of ‘Received:’ headers.
Notice the following limitations:
PM_MAX_MACROSdefine in include/sm/pmfdef.h. In MeTA1 versions up to and including 1.0.PreAlpha28.0, this number is 8. If you need more macros, increase this number and recompile MeTA1.
If bool is
true (see boolean in GNU Mailutils Manual), pass auth macros to mailfromd ‘mail’
handler. It is equivalent to:
define-macros mail (auth_type, auth_authen, auth_author);
This document was generated on January 3, 2019 using makeinfo.Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.