register_smtp_client_state

March 26, 2020

Name

register_smtp_client_state — Register a custom state in the SMTP client state machine

Synopsis

#include "dns_ds.h"

| int **register_smtp_client_state** ( | state, |   |
|   | insert_after); |   |

smtp_state * <var class="pdparam">state</var>;
int <var class="pdparam">insert_after</var>;

Description

Register a custom state in the SMTP client state machine.

The SMTP client state machine is modular: external modules may register their own states to be called after a particular built-in or custom state.

Parameters

state

The SMTP client state to register. All values of this structure (except for smtp_state.closure) are copied to a static variable so memory for state may be released after registering it. For more information on this data structure see “smtp_state”.

insert_after

The state ID to insert the client state after. Passing a value of -1 places the SMTP state at the beginning, prior to the banner state.

Return Values

Returns an SMTP state ID computed by this function or -1 in the case of a failure.

Threading

It is only legal to call this function in the Scheduler thread.

See Also

ec_smtp_closeconn, and smtp_next_state.