aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/spf.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-12 14:06:12 -0400
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-12 14:06:12 -0400
commitb33ceaafc151b17cd8c64a40d46b0f0b43bf3787 (patch)
tree66382b99ec4137278a19f1e20567b638d341c8ce /src/plugins/spf.c
parent67ed140df3137965b2698d45b26a7271c06b574a (diff)
downloadrspamd-b33ceaafc151b17cd8c64a40d46b0f0b43bf3787.tar.gz
rspamd-b33ceaafc151b17cd8c64a40d46b0f0b43bf3787.zip
Fix dependencies for SPF module.
Diffstat (limited to 'src/plugins/spf.c')
-rw-r--r--src/plugins/spf.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index eab58c1d2..d0998b05d 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -75,6 +75,18 @@ module_t spf_module = {
NULL
};
+static GQuark
+spf_plugin_quark (void)
+{
+ return g_quark_from_static_string ("spf-plugin");
+}
+
+static void
+spf_plugin_fin (gpointer ud)
+{
+
+}
+
gint
spf_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
{
@@ -314,6 +326,8 @@ spf_plugin_callback (struct spf_resolved *record, struct rspamd_task *task)
spf_check_list (l, task);
spf_record_unref (l);
}
+
+ rspamd_session_remove_event (task->s, spf_plugin_fin, NULL);
}
@@ -334,8 +348,14 @@ spf_symbol_callback (struct rspamd_task *task, void *unused)
spf_check_list (l, task);
spf_record_unref (l);
}
- else if (!resolve_spf (task, spf_plugin_callback)) {
- msg_info ("cannot make spf request for [%s]", task->message_id);
+ else {
+ if (!resolve_spf (task, spf_plugin_callback)) {
+ msg_info ("cannot make spf request for [%s]", task->message_id);
+ }
+ else {
+ rspamd_session_add_event (task->s, spf_plugin_fin, NULL,
+ spf_plugin_quark ());
+ }
}
}
}