From: Vsevolod Stakhov Date: Tue, 17 Dec 2019 13:38:07 +0000 (+0000) Subject: [Minor] Revert back options for temp/permfail in SPF X-Git-Tag: 2.3~206 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=04e354d919c8802d94de60cc2c8d9ad7c192df6d;p=rspamd.git [Minor] Revert back options for temp/permfail in SPF --- diff --git a/src/libserver/spf.h b/src/libserver/spf.h index 6fd3e1583..451cb5003 100644 --- a/src/libserver/spf.h +++ b/src/libserver/spf.h @@ -22,6 +22,21 @@ typedef enum spf_mech_e { SPF_NEUTRAL } spf_mech_t; +static inline gchar spf_mech_char (spf_mech_t mech) +{ + switch (mech) { + case SPF_FAIL: + return '-'; + case SPF_SOFT_FAIL: + return '~'; + case SPF_PASS: + return '+'; + case SPF_NEUTRAL: + default: + return '?'; + } +} + typedef enum spf_action_e { SPF_RESOLVE_MX, SPF_RESOLVE_A, diff --git a/src/lua/lua_spf.c b/src/lua/lua_spf.c index e3c0686b7..743d523e5 100644 --- a/src/lua/lua_spf.c +++ b/src/lua/lua_spf.c @@ -360,12 +360,12 @@ spf_check_element (lua_State *L, struct spf_resolved *rec, struct spf_addr *addr if (rec->flags & RSPAMD_SPF_RESOLVED_PERM_FAILED) { lua_pushboolean (L, false); lua_pushinteger (L, RSPAMD_SPF_RESOLVED_PERM_FAILED); - lua_pushstring (L, "any perm fail"); + lua_pushfstring (L, "%cany", spf_mech_char (addr->mech)); } else if (rec->flags & RSPAMD_SPF_RESOLVED_TEMP_FAILED) { lua_pushboolean (L, false); lua_pushinteger (L, RSPAMD_SPF_RESOLVED_TEMP_FAILED); - lua_pushfstring (L, "any temp fail"); + lua_pushfstring (L, "%cany", spf_mech_char (addr->mech)); } else { lua_pushboolean (L, true);