Exim -- Received header

d.dobrev

Verified User
Joined
Mar 20, 2018
Messages
56
Hey there,

I'm trying to remove the "Received" from/by header from ***inbound*** messages.
I've tried the following in ACLs: acl_check_mail, acl_script, acl_check_recipient, acl_check_message -- This hides the 2nd/3rd "Received" header, but the first one still remains.
warn message = Remove internal headers
remove_header = Received

And in transports: remote_smtp, remote_smtp_forward_transport -- This works for outbound messages, but not for inbound ones.
headers_remove = received

And also in transport: dovecot_lmtp_udp -- This hides the 2nd "Received" header, but the first one still remains.
headers_remove = received

I also tried setting received_header_text - but it only has effect on the 2nd Received header.

When receiving mail - for some reason, if these are not set, I have 3 "Received" headers such as:
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from my.server.hostname.eu <- I want to remove this header
by my.server.hostname.eu with LMTP
id 2BmZC2mCOmVlEAAAvpS4WA
(envelope-from <[email protected]>)
for <[email protected]>; Thu, 26 Oct 2023 18:14:49 +0300
Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Thu, 26 Oct 2023 18:14:49 +0300
Received: from mail-yw1-f175.google.com ([209.85.128.175]) <- Gets removed (OK)
by my.server.hostname.eu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384
(Exim 4.96.2-12-g29d01ae2a)
(envelope-from <[email protected]>)
id 1qw24P-0002ec-02
for [email protected];
Thu, 26 Oct 2023 18:14:49 +0300
Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-5a7c011e113so8355757b3.1 <- Gets removed (OK)
for <[email protected]>; Thu, 26 Oct 2023 08:14:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
. . . . . the rest


Does anyone have any idea how/where to remove the First one?

SOLVED by adding the following config option to /etc/dovecot.conf
lmtp_add_received_header = no

Regards,
D
 
Last edited:
Back
Top