You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lmtp_proto.h 988B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef RSPAMD_LMTP_PROTO_H
  2. #define RSPAMD_LMTP_PROTO_H
  3. #include "config.h"
  4. struct worker_task;
  5. enum lmtp_state {
  6. LMTP_READ_LHLO,
  7. LMTP_READ_FROM,
  8. LMTP_READ_RCPT,
  9. LMTP_READ_DATA,
  10. LMTP_READ_MESSAGE,
  11. LMTP_READ_DOT,
  12. };
  13. struct rspamd_lmtp_proto {
  14. struct worker_task *task;
  15. enum lmtp_state state;
  16. };
  17. /**
  18. * Read one line of user's input for specified task
  19. * @param lmtp lmtp object
  20. * @param line line of user's input
  21. * @return 0 if line was successfully parsed and -1 if we have protocol error
  22. */
  23. gint read_lmtp_input_line (struct rspamd_lmtp_proto *lmtp, f_str_t *line);
  24. /**
  25. * Deliver message via lmtp/smtp or pipe to LDA
  26. * @param task task object
  27. * @return 0 if we wrote message and -1 if there was some error
  28. */
  29. gint lmtp_deliver_message (struct worker_task *task);
  30. /**
  31. * Write reply for specified lmtp object
  32. * @param lmtp lmtp object
  33. * @return 0 if we wrote reply and -1 if there was some error
  34. */
  35. gint write_lmtp_reply (struct rspamd_lmtp_proto *lmtp);
  36. #endif