Remove received header

Pmta has configuration “remove-received-header = yes” . How do we achieve this in kumomta.

Note : we are using postix for injection and kumomta as relay-host for postfix.

This is done using a Lua call to remove_all_named_headers - KumoMTA Docs

See: start_esmtp_listener - KumoMTA Docs

I will check both docs and try to implement.

/// kumo.start_esmtp_listener {
listen = ‘0.0.0.0:5980’,
hostname = ‘host.oneworkspace.xyz’,

-- override the default set of relay hosts
relay_hosts = { '127.0.0.1', '192.168.1.0/24', '198.27.80.228' },
trace_headers = {
received_header = false,  -- true is the default: add the Received: header
supplemental_header = true, -- true is the default: add the supplemental header
header_name = 'X-KumoRef',   -- this is the default: the name of the supplemental header

-- names of additional meta data fields
-- to include in the header. TAKE CARE! The header will be
-- base64 encoded to prevent casual introspection, but the
-- header is NOT encrypted and the values of the meta data
-- fields included here should be considered to be public.
-- The default is not to add any meta data fields, but you
-- might consider setting something like:
-- include_meta_names = { 'tenant', 'campaign' },
include_meta_names = {},

},
}

add above code. But there is no change show in headers. Do I have to specify which header need to remove ?

Show example message and which header you do not want present.

If you dont specify, how is it going to know which header to remove?

This will remove all “X-” headers:

This will remove a specific header, but you have to specify the name of the header:

Removing ALL headers would be extremely dangerous and would likely stop your email from delivering.

All of this is documented fairly thoroughly: