Browse Source

[Minor] Revert back options for temp/permfail in SPF

tags/2.3
Vsevolod Stakhov 4 years ago
parent
commit
04e354d919
2 changed files with 17 additions and 2 deletions
  1. 15
    0
      src/libserver/spf.h
  2. 2
    2
      src/lua/lua_spf.c

+ 15
- 0
src/libserver/spf.h View File

@@ -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,

+ 2
- 2
src/lua/lua_spf.c View File

@@ -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);

Loading…
Cancel
Save