#include <libmilter/mfapi.h>
#include <libmilter/mfdef.h>
sfsistat (*xxfi_negotiate)(
        SMFICTX    *ctx, 
	unsigned long f0,
	unsigned long f1,
	unsigned long f2,
	unsigned long f3,
	unsigned long *pf0,
	unsigned long *pf1,
	unsigned long *pf2,
	unsigned long *pf3);
Called When Once, at the start of each SMTP connection.
Default Behavior Return SMFIS_ALL_OPTS to change nothing.
ctx the opaque context structure.
f0 the actions offered by the MTA.
f1 the protocol steps offered by the MTA.
f2 for future extensions.
f3 for future extensions.
pf0 the actions requested by the milter.
pf1 the protocol steps requested by the milter.
pf2 for future extensions.
pf3 for future extensions.
Return valueDescription
SMFIS_ALL_OPTS If a milter just wants to inspect the available protocol steps and actions, then it can return SMFIS_ALL_OPTS and the MTA will make all protocol steps and actions available to the milter. In this case, no values should be assigned to the output parameters pf0 - pf3 as they will be ignored.
SMFIS_REJECT Milter startup fails and it will not be contacted again (for the current connection).
SMFIS_CONTINUE Continue processing. In this case the milter must set all output parameters pf0 - pf3. See below for an explanation how to set those output parameters.
NOTES This function allows a milter to dynamically determine and request operations and actions during startup. In previous versions, the actions (f0) were fixed in the flags field of the smfiDesc structure and the protocol steps (f1) were implicitly derived by checking whether a callback was defined. Due to the extensions in the new milter version, such a static selection will not work if a milter requires new actions that are not available when talking to an older MTA. Hence in the negotiation callback a milter can determine which operations are available and dynamically select those which it needs and which are offered. If some operations are not available, the milter may either fall back to an older mode or abort the session and ask the user to upgrade.

Protocol steps (f1, *pf1):

The available actions (f0, *pf0) are described elsewhere (xxfi_flags).

If a milter returns SMFIS_CONTINUE, then it must set the desired actions and protocol steps via the (output) parameters pf0 and pf1 (which correspond to f0 and f1, respectively). The (output) parameters pf2 and pf3 should be set to 0 for compatibility with future versions.

Copyright (c) 2006 Proofpoint, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the LICENSE.