aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/spf.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-11-22 16:56:28 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-11-22 16:56:28 +0000
commite9f8d4f2797da204276de066cd64ff0f1c1a9c2f (patch)
tree26c393b640d0c122044d735b82b389064b8f07f6 /src/libserver/spf.c
parent4234ed52ba22ab5e308170959e9557f8f35df273 (diff)
downloadrspamd-e9f8d4f2797da204276de066cd64ff0f1c1a9c2f.tar.gz
rspamd-e9f8d4f2797da204276de066cd64ff0f1c1a9c2f.zip
[Minor] Write SPF digest even if it is not cached
Diffstat (limited to 'src/libserver/spf.c')
-rw-r--r--src/libserver/spf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libserver/spf.c b/src/libserver/spf.c
index 7dd5ed31c..e4462cd66 100644
--- a/src/libserver/spf.c
+++ b/src/libserver/spf.c
@@ -607,6 +607,7 @@ rspamd_spf_maybe_return (struct spf_record *rec)
{
struct spf_resolved *flat;
struct rspamd_task *task = rec->task;
+ bool cached = false;
if (rec->requests_inflight == 0 && !rec->done) {
flat = rspamd_spf_record_flatten (rec);
@@ -620,16 +621,26 @@ rspamd_spf_maybe_return (struct spf_record *rec)
spf_record_ref (flat),
flat->timestamp, flat->ttl);
- msg_info_task ("stored record for %s (0x%xuL) in LRU cache for %d seconds, "
+ msg_info_task ("stored SPF record for %s (0x%xuL) in LRU cache for %d seconds, "
"%d/%d elements in the cache",
flat->domain,
flat->digest,
flat->ttl,
rspamd_lru_hash_size (spf_lib_ctx->spf_hash),
rspamd_lru_hash_capacity (spf_lib_ctx->spf_hash));
+ cached = true;
}
}
+ if (!cached) {
+ /* Still write a log line */
+ msg_info_task ("not stored SPF record for %s (0x%xuL) in LRU cache; flags=%d; ttl=%d",
+ flat->domain,
+ flat->digest,
+ flat->flags,
+ flat->ttl);
+ }
+
rec->callback (flat, rec->task, rec->cbdata);
spf_record_unref (flat);
rec->done = TRUE;