Skip to content

Commit

Permalink
[Minor] Fix x-os-fingerprint header
Browse files Browse the repository at this point in the history
Pass correct parameter to add_header function and use double when unpacking integers from mempool
  • Loading branch information
denpamusic committed Oct 23, 2019
1 parent deacaf7 commit 66c07a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/lua/milter_headers.lua
Expand Up @@ -422,19 +422,19 @@ local function milter_headers(task)

local os_string, link_type, uptime_min, distance =
task:get_mempool():get_variable('os_fingerprint',
'string, string, int, int');
'string, string, double, double');

if not os_string then return end

local value = string.format('%s, (up: %u min), (distance %i, link: %s)',
local value = string.format('%s, (up: %i min), (distance %i, link: %s)',
os_string, uptime_min, distance, link_type)

if settings.routines['x-os-fingerprint'].remove then
remove[settings.routines['x-os-fingerprint'].header]
= settings.routines['x-os-fingerprint'].remove
end

add_header(settings.routines['x-os-fingerprint'].header, value)
add_header('x-os-fingerprint', value)
end

routines['x-spam-status'] = function()
Expand Down

0 comments on commit 66c07a2

Please sign in to comment.