aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/spf.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-09-24 13:13:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-09-24 13:13:32 +0100
commit67660ea3d469aed76219fdbbc9d03f3dd7291703 (patch)
tree6f389d6099ca94ebf2ed93bd0ed2b7c0bd30b578 /src/plugins/spf.c
parent12df275efe7e4bd45c40c8287be587b422ea39ca (diff)
downloadrspamd-67660ea3d469aed76219fdbbc9d03f3dd7291703.tar.gz
rspamd-67660ea3d469aed76219fdbbc9d03f3dd7291703.zip
Convert spf module to GError reporting.
Diffstat (limited to 'src/plugins/spf.c')
-rw-r--r--src/plugins/spf.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index 273243c13..44a28061c 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -284,18 +284,25 @@ spf_check_list (GList *list, struct worker_task *task)
}
static void
-spf_plugin_callback (struct spf_record *record, struct worker_task *task)
+spf_plugin_callback (struct spf_record *record, struct worker_task *task, GError *err)
{
GList *l;
- if (record && record->addrs && record->sender_domain) {
+ if (err == NULL) {
+ if (record && record->addrs && record->sender_domain) {
- if ((l = rspamd_lru_hash_lookup (spf_module_ctx->spf_hash, record->sender_domain, task->tv.tv_sec)) == NULL) {
- l = spf_record_copy (record->addrs);
- rspamd_lru_hash_insert (spf_module_ctx->spf_hash, g_strdup (record->sender_domain),
- l, task->tv.tv_sec);
+ if ((l = rspamd_lru_hash_lookup (spf_module_ctx->spf_hash, record->sender_domain, task->tv.tv_sec)) == NULL) {
+ l = spf_record_copy (record->addrs);
+ rspamd_lru_hash_insert (spf_module_ctx->spf_hash, g_strdup (record->sender_domain),
+ l, task->tv.tv_sec);
+ }
+ spf_check_list (l, task);
}
- spf_check_list (l, task);
+ }
+ else {
+ msg_info ("<%s> cannot check SPF record for domain %s: %s",
+ task->message_id, record ? "null" : record->sender_domain,
+ err->message);
}
}