How can i make the received_from header match the hostname and ip of the sending proxy ?
I found some examples here on discord but there is a missing function that i cannot find anywhere that a user was using called “extractIPAddress” ex: local ipAddress = extractIPAddress(msg:get_meta(‘received_from’))
i think that this would do what i need. Is this modification done inside the “smtp_server_message_received” function ?
As an example:
Received: from domain.com (192.168.1.1)
by mta.domain.com (KumoMTA 192.168.1.1)
I just need to set this header to the sending proxy as origin instead of exposing my central server
thanks in advance
my curent configuration on the http_message_generated is very simple:
kumo.on('http_message_generated', function(msg)
-- Call the queue helper to set up the queue for the message.
local tenant = cached_tenant_id(msg:from_header().domain)
if tenant then
msg:set_meta('source', 'http')
msg:set_meta('tenant', tenant)
msg:append_header('X-CUSTOMER-ID', tenant)
end
print(msg:get_data())
queue_helper:apply(msg)
-- SIGNING MUST COME LAST OR YOU COULD BREAK YOUR DKIM SIGNATURES
dkim_signer(msg)
end)