allow_hdrfrom_multiple = false;
# If true, username does not need to contain matching domain
allow_username_mismatch = false;
- # If false, messages from authenticated users are not selected for signing
- auth_only = false;
# Default path to key, can include '$domain' and '$selector' variables
#path = "${DBDIR}/arc/$domain.$selector.key";
# Default selector to use
selector = "arc";
+ # If false, messages from authenticated users are not selected for signing
+ sign_authenticated = false;
# If false, inbound messages are not selected for signing
sign_inbound = true;
# If false, messages from local networks are not selected for signing
allow_hdrfrom_multiple = false;
# If true, username does not need to contain matching domain
allow_username_mismatch = false;
- # If false, messages from authenticated users are not selected for signing
- auth_only = true;
# Default path to key, can include '$domain' and '$selector' variables
#path = "/var/lib/rspamd/dkim/$domain.$selector.key";
# Default selector to use
selector = "dkim";
+ # If false, messages from authenticated users are not selected for signing
+ sign_authenticated = true;
# If false, messages from local networks are not selected for signing
sign_local = true;
# Symbol to add when message is signed
end
end
+ -- DKIM signing/ARC legacy
+ for _, mod in ipairs({'dkim_signing', 'arc'}) do
+ if cfg[mod] then
+ if cfg[mod].auth_only ~= nil then
+ if cfg[mod].sign_authenticated ~= nil then
+ logger.warnx(rspamd_config, 'both auth_only (%s) and sign_authenticated (%s) for %s are specified, prefer auth_only', cfg[mod].auth_only, cfg[mod].sign_authenticated, mod)
+ end
+ cfg.[mod].sign_authenticated = cfg.[mod].auth_only
+ end
+ end
+ end
+
if cfg.dkim and cfg.dkim.sign_headers and type(cfg.dkim.sign_headers) == 'table' then
-- Flatten
cfg.dkim.sign_headers = table.concat(cfg.dkim.sign_headers, ':')
is_local = true
end
- if settings.auth_only and auser then
+ if settings.sign_authenticated and auser then
lua_util.debugm(N, task, 'user is authenticated')
is_authed = true
elseif (settings.sign_networks and settings.sign_networks:get_key(ip)) then
elseif settings.sign_inbound and not is_local and not auser then
lua_util.debugm(N, task, 'mail was sent to us')
else
- lua_util.debugm(N, task, 'ignoring unauthenticated mail')
+ lua_util.debugm(N, task, 'mail is ineligible for signing')
return false,{}
end
local function is_skip_sign()
return not (settings.sign_networks and is_sign_networks) and
- not (settings.auth_only and is_authed) and
+ not (settings.sign_authenticated and is_authed) and
not (settings.sign_local and is_local)
end
local sign_type = readline_default('Enter your choice (1, 2, 3, 4) [default: 1]: ', '1')
local sign_networks
local allow_mismatch
- local auth_only
+ local sign_authenticated
local use_esld
local sign_domain = 'pet luacheck'
end
if sign_type ~= '3' then
- auth_only = ask_yes_no(
- string.format('Do you want to sign mail from %s only? ',
+ sign_authenticated = ask_yes_no(
+ string.format('Do you want to sign mail from %s? ',
highlight('authenticated users')), true)
else
- auth_only = true
+ sign_authenticated = true
end
if fun.any(function(s) return s == sign_domain end, defined_auth_types) then
end
res_tbl.use_esld = use_esld
- res_tbl.auth_only = auth_only
+ res_tbl.sign_authenticated = sign_authenticated
end
local function check_redis_classifier(cls, changes)
allow_hdrfrom_mismatch_sign_networks = false,
allow_hdrfrom_multiple = false,
allow_username_mismatch = false,
- auth_only = true,
+ sign_authenticated = true,
domain = {},
path = string.format('%s/%s/%s', rspamd_paths['DBDIR'], 'arc', '$domain.$selector.key'),
sign_local = true,
allow_hdrfrom_multiple = false,
allow_username_mismatch = false,
allow_pubkey_mismatch = true,
- auth_only = true,
+ sign_authenticated = true,
check_pubkey = false,
domain = {},
path = string.format('%s/%s/%s', rspamd_paths['DBDIR'], 'dkim', '$domain.$selector.key'),