smfi_setsymlist Function

Purpose

The smfi_setsymlist function sets the list of macros that the milter parameter wants to receive from the mail transfer agent (MTA) for a protocol stage.

Syntax

#include <libmilter/mfapi.h>
int smfi_setsymlist(
        SMFICTX    *ctx, 
	int        stage,
	char     *macros  
);

Description

The smfi_setsymlist callback function must be called during the xxfi_negotiate function, and this function can be used to override the list of macros that the milter parameter wants to receive from the mail transfer agent (MTA).

Note: There is an internal limit on the number of macros that can be set (currently 5). However, this limit is not enforced by the milter parameter, and is enforced only by the MTA, but a possible violation of this restriction is not communicated back to the milter parameter.

Arguments

Table 1. Arguments
Item Description
ctx The opaque context structure maintained in libmilter parameter.
stage The protocol stage during which the macro list should be used. See the include/libmilter/mfapi.h file for legal values, and look for the C macros with the SMFIM_ prefix. Available protocol stages are at least the initial connection, HELO or EHLO, MAIL, RCPT, DATA, end of header, and the end of a message.
macros The list of macros (separated by space). For example: "{rcpt_mailer} {rcpt_host}".

Return values

The smfi_setsymlist function returns the MI_FAILURE value in the following cases. Otherwise the function returns MI_SUCCESS.
  • There is no enough free memory to make a copy of the macro list.
  • The macros are NULL or empty.
  • The stage is not a valid protocol stage.
  • The macro list for a stage has been set before.

Related information

xxfi_negotiate