smtp-server.h revision 9249c80276766fdc4d31fc3eebc22fba7d53d77c
1b33c96954667ba382fa595baf7b31290bfdd517vboxsyncextern const char *const smtp_server_state_names[];
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync const char *domain;
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync bool domain_valid:1; /* valid domain/literal specified */
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync bool old_smtp:1; /* client sent HELO rather than EHLO */
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync * Transaction
1b33c96954667ba382fa595baf7b31290bfdd517vboxsyncARRAY_DEFINE_TYPE(smtp_server_recipient, struct smtp_server_recipient *);
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync const char *id;
1b33c96954667ba382fa595baf7b31290bfdd517vboxsyncvoid smtp_server_transaction_write_trace_record(string_t *str,
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync * Callbacks
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync bool changed:1; /* this EHLO/HELO/LHLO is the first or
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync different from a previous one */
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync /* called once the recipient is definitively added to the transaction */
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync void (*hook_finished)(struct smtp_server_cmd_ctx *cmd,
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync unsigned int index);
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync /* Command callbacks:
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync These are used to override/implement the behavior of the various core
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync SMTP commands. Commands are handled asynchronously, which means that
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync the command is not necessarily finished when the callback ends. A
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync command is finished either when 1 is returned or a reply is submitted
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync for it. When a callback returns 0, the command implementation is
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync waiting for an external event and when it returns -1 an error
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync occurred. When 1 is returned, a default success reply is set if no
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync reply was submitted. Not submitting an error reply when -1 is
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync returned causes an assert fail. Except for RCPT and DATA, all these
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync callbacks are optional to implement; appropriate default behavior is
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync The SMTP server API takes care of transaction state checking.
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync However, until all previous commands are handled, a transaction
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync command cannot rely on the transaction state being final. Use
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync cmd->hook_next to get notified when all previous commands are
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync finished and the current command is next in line to reply.
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync If the implementation does not need asynchronous behavior, set
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync max_pipelined_commands=1 and don't return 0 from any command handler.
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync /* STARTTLS */
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync struct smtp_server_cmd_ctx *cmd, const char *response);
1b33c96954667ba382fa595baf7b31290bfdd517vboxsync const char *param);
struct smtp_server_settings {
const char *hostname;
const char *login_greeting;
const char *rawlog_dir;
unsigned int max_client_idle_time_msecs;
unsigned int max_pipelined_commands;
unsigned int max_bad_commands;
unsigned int max_recipients;
const char *const *xclient_extensions;
struct smtp_server_stats {
struct smtp_server_connection *
struct smtp_server_connection *
bool ssl_start);
const unsigned char *pdata,
bool client_input);
enum smtp_server_state
struct smtp_server_transaction *
const struct smtp_server_stats *
enum smtp_protocol
struct smtp_server_helo_data *
enum smtp_server_command_flags {
const char *params);
struct smtp_server_cmd_ctx {
const char *name;
void *context;
enum smtp_server_command_flags);
const char *name);
unsigned int count);
struct smtp_server_reply *
unsigned int idx);
unsigned int status);
const char *challenge);
struct smtp_server_reply *
struct smtp_server_reply *
struct smtp_server_reply *
const char *line);
struct smtp_server_reply *
const char *keyword);