diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-17 20:25:48 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-17 20:25:48 +0400 |
commit | 26eed5a540674c0fce99883a64c7675d7c5cbb92 (patch) | |
tree | 76945e5ad58c561200ef09c739807af2b0e2e986 /src/greylist.h | |
parent | de84c16025fd54d2f1c67cfe6a462e9c929c6244 (diff) | |
download | rspamd-26eed5a540674c0fce99883a64c7675d7c5cbb92.tar.gz rspamd-26eed5a540674c0fce99883a64c7675d7c5cbb92.zip |
* Implement initial version of greylisting triplets storage
* Fix issues with smtp worker
Diffstat (limited to 'src/greylist.h')
-rw-r--r-- | src/greylist.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/greylist.h b/src/greylist.h new file mode 100644 index 000000000..b17004c2e --- /dev/null +++ b/src/greylist.h @@ -0,0 +1,47 @@ +#ifndef RSPAMD_GREYLIST_H +#define RSPAMD_GREYLIST_H + +#include "config.h" + +#define CHECKSUM_SIZE 16 +/* 5 minutes */ +#define DEFAULT_GREYLIST_TIME 300 +/* 2 days */ +#define DEFAULT_EXPIRE_TIME 60 * 60 * 24 * 2 + +/** + * Item in storage + */ +struct rspamd_grey_item { + time_t age; /**< age of checksum */ + guint8 data[CHECKSUM_SIZE]; /**< checksum of triplet */ +}; + +/** + * Protocol command that is used to work with greylist storage + */ +struct rspamd_grey_command { + enum { + GREY_CMD_ADD = 0, + GREY_CMD_CHECK, + GREY_CMD_DEL + } cmd; + gint version; + guint8 data[CHECKSUM_SIZE]; +}; + +/** + * Reply packet + */ +struct rspamd_grey_reply { + enum { + GREY_OK = 0, + GREY_GREYLISTED, + GREY_EXPIRED, + GREY_NOT_FOUND, + GREY_ERR + } reply; +}; + + +#endif |