Mailfromd Manual (split by node):   Section:   Chapter:FastBack: pmult   Up: pmult configuration   FastForward: Reporting Bugs   Contents: Table of ContentsIndex: Concept Index

13.1.2 Translating MeTA1 macros.

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 pmult takes 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:

client_addr

The IP address of the SMTP client. As of version 8.7, only IPv4 addresses are supported. Defined in all handlers.

client_port

The port number of the SMTP client. Defined in all handlers.

i

MeTA1 session ID. Defined in all handlers.

f

The envelope sender (from) address. Defined in envfrom and subsequent handlers.

nbadrcpts

The number of bad recipients for a single message. Defined in envfrom and envrcpt handlers.

ntries

The number of delivery attempts. As of version 8.7 it is always ‘1’. Defined in envfrom and subsequent handlers.

nrcpts

The number of validated recipients for a single message. Defined in envfrom and envrcpt handlers.

r

Protocol used to receive the message. The value of this macro is always ‘SMTP’. Defined in all handlers.

rcpt_host

The host from the resolved triple of the address given for the SMTP RCPT command. Defined in envrcpt handler.

rcpt_addr

The address part of the resolved triple of the address given for the SMTP RCPT command. Defined in envrcpt handler.

s

Sender’s helo domain (parameter to EHLO or HELO command).

Two additional macros are provided for all handlers that allow to identify whether the message is processed via pmult:

multiplexer

Canonical name of the multiplexer program, i.e. ‘pmult’.

mult_version

Version of 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 using the define-macros statement.

Pmult Conf: define-macros handler macros

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

Hostname of SMTP server.

client_resolve

Result of client lookup.

tls_version

TLS/SSL version used.

tls_cipher_suite

TLS cipher suite used.

tls_cipher_bits

Effective key length of the symmetric encryption algorithm.

tls_cert_subject

The DN (distinguished name) of the presented certificate.

tls_cert_issuer

The DN (distinguished name) of the CA (certificate authority) that signed the presented certificate (the cert issuer).

tls_alg_bits

Maximum key length of the symmetric encryption algorithm. This may be less than the effective key length for export controlled algorithms.

tls_vrfy

The result of the verification of the presented cert.

tls_cn_subject
cn_subject

The CN (common name) of the presented certificate.

tls_cn_issuer
cn_issuer

The CN (common name) of the CA that signed the presented certificate.

auth_type

The mechanism used for SMTP authentication (only set if successful).

auth_authen

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.

auth_author

The authorization identity, i.e. the ‘AUTH=’ parameter of the SMTP MAIL command if supplied.

taid

MeTA1 transaction id.

msgid

Message-Id of the message.

c

The hop count. Basically, this is the number of ‘Received:’ headers.

Notice the following limitations:

  1. taid’ cannot be requested before ‘mail’ stage.
  2. msgid’ can be requested only in ‘dot’ stage.
  3. All ‘tls_*’ macros are valid only after a STARTTLS command.
  4. The number of MeTA1 macros per stage is limited by PM_MAX_MACROS define 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.
Pmult Conf: auth-macros bool

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);

Mailfromd Manual (split by node):   Section:   Chapter:FastBack: pmult   Up: pmult configuration   FastForward: Reporting Bugs   Contents: Table of ContentsIndex: Concept Index