diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-02-24 20:16:53 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-02-24 20:16:53 +0300 |
commit | 1cd34f5283bcf1d4973a351dc5235094608e3d2d (patch) | |
tree | 2d6185294cfea7c3c062c8d2123df96f5e02e1b0 /src/lmtp_proto.h | |
parent | 606128de4cb33a2727d6609df46ecf0c72006a73 (diff) | |
download | rspamd-1cd34f5283bcf1d4973a351dc5235094608e3d2d.tar.gz rspamd-1cd34f5283bcf1d4973a351dc5235094608e3d2d.zip |
* Add initial LMTP support and LDA delivery to rspamd
Diffstat (limited to 'src/lmtp_proto.h')
-rw-r--r-- | src/lmtp_proto.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/lmtp_proto.h b/src/lmtp_proto.h new file mode 100644 index 000000000..24cba2c5e --- /dev/null +++ b/src/lmtp_proto.h @@ -0,0 +1,44 @@ +#ifndef RSPAMD_LMTP_PROTO_H +#define RSPAMD_LMTP_PROTO_H + +#include "config.h" + +struct worker_task; + +enum lmtp_state { + LMTP_READ_LHLO, + LMTP_READ_FROM, + LMTP_READ_RCPT, + LMTP_READ_DATA, + LMTP_READ_MESSAGE, + LMTP_READ_DOT, +}; + +struct rspamd_lmtp_proto { + struct worker_task *task; + enum lmtp_state state; +}; + +/** + * Read one line of user's input for specified task + * @param lmtp lmtp object + * @param line line of user's input + * @return 0 if line was successfully parsed and -1 if we have protocol error + */ +int read_lmtp_input_line (struct rspamd_lmtp_proto *lmtp, f_str_t *line); + +/** + * Deliver message via lmtp/smtp or pipe to LDA + * @param task task object + * @return 0 if we wrote message and -1 if there was some error + */ +int lmtp_deliver_message (struct worker_task *task); + +/** + * Write reply for specified lmtp object + * @param lmtp lmtp object + * @return 0 if we wrote reply and -1 if there was some error + */ +int write_lmtp_reply (struct rspamd_lmtp_proto *lmtp); + +#endif |