diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-29 11:52:02 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-29 11:52:02 +0000 |
commit | 4ee4827ec25af72c0a8306764b9e41fc38e18fc3 (patch) | |
tree | bcdf7c33d23693930eb6bd304f49f1c718ccefa7 /src/libserver/spf.h | |
parent | 4e516ef44345e2f015572c83ba1bfb32f93c820a (diff) | |
download | rspamd-4ee4827ec25af72c0a8306764b9e41fc38e18fc3.tar.gz rspamd-4ee4827ec25af72c0a8306764b9e41fc38e18fc3.zip |
[Rework] Move LRU SPF cache from spf plugin
Diffstat (limited to 'src/libserver/spf.h')
-rw-r--r-- | src/libserver/spf.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libserver/spf.h b/src/libserver/spf.h index 9fcb01d1e..1a0d8bfcf 100644 --- a/src/libserver/spf.h +++ b/src/libserver/spf.h @@ -45,6 +45,7 @@ typedef enum spf_action_e { #define RSPAMD_SPF_FLAG_NA (1u << 9u) #define RSPAMD_SPF_FLAG_PERMFAIL (1u << 10u) #define RSPAMD_SPF_FLAG_RESOLVED (1u << 11u) +#define RSPAMD_SPF_FLAG_CACHED (1u << 12u) /** Default SPF limits for avoiding abuse **/ #define SPF_MAX_NESTING 10 @@ -84,19 +85,26 @@ struct spf_resolved { ref_entry_t ref; /* Refcounting */ }; +struct rspamd_spf_cred { + gchar *local_part; + gchar *domain; + gchar *sender; +}; /* * Resolve spf record for specified task and call a callback after resolution fails/succeed */ -gboolean rspamd_spf_resolve (struct rspamd_task *task, spf_cb_t callback, - gpointer cbdata); +gboolean rspamd_spf_resolve (struct rspamd_task *task, + spf_cb_t callback, + gpointer cbdata, + struct rspamd_spf_cred *cred); /* * Get a domain for spf for specified task */ const gchar *rspamd_spf_get_domain (struct rspamd_task *task); - +struct rspamd_spf_cred *rspamd_spf_get_cred (struct rspamd_task *task); /* * Increase refcount */ |