#ifndef SMTP_SERVER_PRIVATE_H
#define SMTP_SERVER_PRIVATE_H
#include "connection.h"
#include "smtp-server.h"
#define SMTP_SERVER_DEFAULT_CAPABILITIES \
struct smtp_server_reply;
struct smtp_server_command;
struct smtp_server_connection;
enum smtp_server_command_state {
/* New command; callback to command start handler executing. */
/* This command is being processed; command data is fully read, but no
reply is yet submitted */
/* A reply is submitted for this command. If not all command data was
read by the handler, it is first skipped on the input. If this is a
multi-reply command (LMTP->DATA), not all replies may be submitted
yet. */
/* Request is ready for sending reply; a reply is submitted and the
command payload is fully read. If this is a multi-reply command
(LMTP->DATA), not all replies may be submitted yet. In that case the
command state goes back to PROCESSING once the all submitted replies
are sent. */
/* The reply for the command is sent */
/* Request is aborted; still lingering due to references */
};
struct smtp_server_reply_content {
unsigned int status;
const char *status_prefix;
};
struct smtp_server_reply {
unsigned int index;
/* replies may share content */
};
struct smtp_server_command_reg {
const char *name;
};
struct smtp_server_command {
unsigned int refcount;
unsigned int replies_expected;
unsigned int replies_submitted;
/* private hooks */
/* next: command is next to reply but has not submittted all replies yet */
/* replied: command has submitted all replies */
/* completed: server is about to send last replies for this command */
/* destroy: command is about to be destroyed */
/* private context data */
void *data;
};
struct smtp_server_state_data {
unsigned int data_chunks;
};
struct smtp_server_connection {
unsigned int refcount;
void *context;
unsigned int socket_family;
unsigned int proxy_ttl_plus_1;
unsigned int proxy_timeout_secs;
unsigned int id;
unsigned int command_queue_count;
unsigned int bad_counter;
char *disconnect_reason;
};
struct smtp_server {
};
static inline const char *
{
return "[INVALID]";
}
static inline const char *
{
}
struct smtp_server_connection *conn);
/*
* Reply
*/
/*
* Command
*/
struct smtp_server_command *
struct smtp_server_command *
static inline bool
{
}
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
const char *params);
/*
* Connection
*/
struct connection_list *smtp_server_connection_list_init(void);
struct smtp_server_connection *conn);
struct smtp_server_connection *conn,
enum smtp_server_state state);
struct smtp_server_transaction *
const struct smtp_proxy_data *proxy_data);
/*
* Transaction
*/
struct smtp_server_transaction *
const struct smtp_address *mail_from,
const struct smtp_params_mail *params,
struct smtp_server_recipient *
const struct smtp_address *rcpt_to,
const struct smtp_params_rcpt *params);
unsigned int
#endif