diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-09 21:51:25 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-09 21:51:25 +0400 |
commit | 1be79df4d51fc2e497a73fc0163de08d406cc1f3 (patch) | |
tree | 4fadca3e454eef111b891b78c158c773867ff80e /src/smtp.h | |
parent | 8c2f8714f731478859f1aa884fb24dff545e24ce (diff) | |
download | rspamd-1be79df4d51fc2e497a73fc0163de08d406cc1f3.tar.gz rspamd-1be79df4d51fc2e497a73fc0163de08d406cc1f3.zip |
* Implement basic SMTP dialog:
- delay
- helo
- mail from
- rcpt
* Implement interaction with smtp upstream (with support of XCLIENT)
Diffstat (limited to 'src/smtp.h')
-rw-r--r-- | src/smtp.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/smtp.h b/src/smtp.h index 6d9d7555f..36319bb4c 100644 --- a/src/smtp.h +++ b/src/smtp.h @@ -23,11 +23,12 @@ struct smtp_worker_ctx { memory_pool_t *pool; char *smtp_banner; uint32_t smtp_delay; + uint32_t delay_jitter; struct timeval smtp_timeout; gboolean use_xclient; gboolean helo_required; - const char *smtp_capabilities; + char *smtp_capabilities; }; enum rspamd_smtp_state { @@ -38,10 +39,13 @@ enum rspamd_smtp_state { SMTP_STATE_HELO, SMTP_STATE_FROM, SMTP_STATE_RCPT, + SMTP_STATE_BEFORE_DATA, SMTP_STATE_DATA, SMTP_STATE_EOD, SMTP_STATE_END, + SMTP_STATE_WAIT_UPSTREAM, SMTP_STATE_ERROR, + SMTP_STATE_CRITICAL_ERROR, SMTP_STATE_WRITE_ERROR }; @@ -50,18 +54,28 @@ struct smtp_session { memory_pool_t *pool; enum rspamd_smtp_state state; + enum rspamd_smtp_state upstream_state; + struct rspamd_worker *worker; struct worker_task *task; struct in_addr client_addr; char *hostname; char *error; int sock; + int upstream_sock; + time_t session_time; + + gchar *helo; + GList *from; + GList *rcpt; + GList *cur_rcpt; struct rspamd_async_session *s; rspamd_io_dispatcher_t *dispatcher; + rspamd_io_dispatcher_t *upstream_dispatcher; struct smtp_upstream *upstream; - int upstream_sock; gboolean resolved; + gboolean esmtp; }; void start_smtp_worker (struct rspamd_worker *worker); |