if (lua_isstring (L, 3)) {
how = lua_tostring (L, 3);
- if (g_ascii_strcasecmp (how, "cr") == 0) {
+ if (strcmp (how, "cr") == 0) {
folded = rspamd_header_value_fold (name, value, 0,
RSPAMD_TASK_NEWLINES_CR);
}
- else if (g_ascii_strcasecmp (how, "lf") == 0) {
+ else if (strcmp (how, "lf") == 0) {
folded = rspamd_header_value_fold (name, value, 0,
RSPAMD_TASK_NEWLINES_LF);
}
rspamd_config:register_dependency(id, symbols['dkim_allow_symbol'])
local function arc_sign_seal(task, params, header)
+ local fold_type = "crlf"
local arc_sigs = task:cache_get('arc-sigs')
local arc_seals = task:cache_get('arc-seals')
local arc_auth_results = task:get_header_full('ARC-Authentication-Results') or {}
local cur_auth_results = auth_results.gen_auth_results(task) or ''
local privkey
+ if task:has_flag("milter") then
+ fold_type = "lf"
+ end
+
if params.rawkey then
privkey = rspamd_rsa_privkey.load_pem(params.rawkey)
elseif params.key then
header = rspamd_util.fold_header(
'ARC-Message-Signature',
- header)
+ header, fold_type)
cur_auth_results = rspamd_util.fold_header(
'ARC-Authentication-Results',
- cur_auth_results)
+ cur_auth_results, fold_type)
cur_auth_results = string.format('i=%d; %s', cur_idx, cur_auth_results)
local s = dkim_canonicalize('ARC-Authentication-Results',
['ARC-Message-Signature'] = header,
['ARC-Seal'] = rspamd_util.fold_header(
'ARC-Seal',
- cur_arc_seal),
+ cur_arc_seal, fold_type),
}
})
task:insert_result(settings.sign_symbol, 1.0, string.format('i=%d', cur_idx))