smfi_getsymval Function

Purpose

The smfi_getsymval function fetches the value of a sendmail macro.

Syntax

#include <libmilter/mfapi.h>
char* smfi_getsymval(
SMFICTX *ctx,
char *headerf,
char *symname
);

Description

The smfi_getsymval function is called from any of the xxfi_* callback functions to add a header to the message. The macro definition depends on the function that is called.

By default, the following macros are valid:
Table 1. Description
Item Description
xxfi_connect daemon_name, if_name, if_addr, j, _
xxfi_hello tls_version, cipher, cipher_bits, cert_subject, cert_issuer
xxfi_envfrom i, auth_type, auth_authen, auth_ssf, auth_author, mail_mailer, mail_host, mail_addr
xxfi_envrcpt rcpt_mailer, rcpt_host, rcpt_addr
xxfi_data None
xxfi_eoh None
xxfi_eom msg_id

All macros remain in effect from the point they are received until the end of the connection for the xxfi_connect, xxfi_hello functions.

All macros stay in effect until the end of the message for the xxfi_envfrom function , and the xxfi_eom function.

All the macros stay in effect for each recipient for xxfi_envrcpt function.

The macro list can be changed by using the confMILTER_MACROS_* options in the sendmail.mc. The scope of such macros is determined by when they are set by the sendmail command. For descriptions of macros values, see Sendmail Installation and Operation Guide.

Arguments

Table 2. Arguments
Item Description
ctx The opaque context structure is maintained in the libmilter parameter.
symname The name of a sendmail macro. Single letter macros can optionally be enclosed in braces ("{" and "}"), longer macro names must be enclosed in braces, as in a sendmail.cf file.

Return values

The smfi_getsymval function returns the value of the given macro as a null-terminated string. Otherwise, the smfi_getsymval function returns NULL if the macro is not defined.

Related information

libmilter_xxfi_connect.html

libmilter_xxfi_helo.html

libmilter_xxfi_envfrom.html

libmilter_xxfi_envrcpt.html

libmilter_xxfi_data.html

libmilter_xxfi_eoh.html

libmilter_xxfi_eom.html