]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Some small changes to the logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 5 Dec 2019 20:31:31 +0000 (20:31 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 5 Dec 2019 20:31:31 +0000 (20:31 +0000)
src/lua/lua_spf.c
test/functional/cases/117_spf.robot

index c7ab5d4f8a61827a1a2492ad6a9bcc04293bf3b6..6c3a47451c1b3d2eb4212e0e86cbd459c44b2a57 100644 (file)
@@ -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);
index 309a0aaef409bf9631ad07d018b74277bd3ae065..bfb56065f5cd05a5c3770571d33dfda6addec931 100644 (file)
@@ -125,7 +125,7 @@ SPF PTRS
 SPF PERMFAIL REDIRECT WITHOUT SPF
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/dmarc/bad_dkim4.eml
   ...  -i  192.0.2.1  -F  a@fail1.org.org.za
-  Check Rspamc  ${result}  R_SPF_PERMFAIL
+  Check Rspamc  ${result}  R_SPF_DNSFAIL
 
 *** Keywords ***
 SPF Setup