aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-05 20:31:31 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-05 20:31:31 +0000
commit4d5b9740d6b42140549ce6b2da3f3b704c4d620a (patch)
tree0f3ce4da704cf4c93a95c22544e9026739e91061 /src
parentdf3b0491a86d6e0cb291074632541a325f4660f1 (diff)
downloadrspamd-4d5b9740d6b42140549ce6b2da3f3b704c4d620a.tar.gz
rspamd-4d5b9740d6b42140549ce6b2da3f3b704c4d620a.zip
[Minor] Some small changes to the logic
Diffstat (limited to 'src')
-rw-r--r--src/lua/lua_spf.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lua/lua_spf.c b/src/lua/lua_spf.c
index c7ab5d4f8..6c3a47451 100644
--- a/src/lua/lua_spf.c
+++ b/src/lua/lua_spf.c
@@ -173,17 +173,19 @@ spf_lua_lib_callback (struct spf_resolved *record, struct rspamd_task *task,
lua_spf_push_result (cbd, RSPAMD_SPF_RESOLVED_NA, NULL,
"no record found");
}
- else if (record->elts->len == 0 && (record->flags & RSPAMD_SPF_RESOLVED_TEMP_FAILED)) {
- lua_spf_push_result (cbd, RSPAMD_SPF_RESOLVED_TEMP_FAILED, NULL,
- "temporary resolution error");
- }
- else if (record->elts->len == 0 && (record->flags & RSPAMD_SPF_RESOLVED_PERM_FAILED)) {
- lua_spf_push_result (cbd, RSPAMD_SPF_RESOLVED_PERM_FAILED, NULL,
- "permanent resolution error");
- }
else if (record->elts->len == 0) {
- lua_spf_push_result (cbd, RSPAMD_SPF_RESOLVED_PERM_FAILED, NULL,
- "record is empty");
+ if (record->flags & RSPAMD_SPF_RESOLVED_PERM_FAILED) {
+ lua_spf_push_result (cbd, RSPAMD_SPF_RESOLVED_PERM_FAILED, NULL,
+ "permanent resolution error");
+ }
+ else if ((record->flags & RSPAMD_SPF_RESOLVED_TEMP_FAILED)) {
+ lua_spf_push_result (cbd, RSPAMD_SPF_RESOLVED_TEMP_FAILED, NULL,
+ "temporary resolution error");
+ }
+ else {
+ lua_spf_push_result (cbd, RSPAMD_SPF_RESOLVED_PERM_FAILED, NULL,
+ "record is empty");
+ }
}
else if (record->domain) {
spf_record_ref (record);