Mailing List Archive

Hide IP address of authenticated users
Hello,

I'd like to hide the IP address of authenticated users sending their
messages over my SMTP server. The address always appears in the
"Received" header and remains there for the final recipient.

A web search has only led to this information:

https://serverfault.com/questions/1035035/remove-ip-and-username-from-exim-mail-headers

I couldn't find any information about the suggested solution. That
all-caps name is mentioned in very long Debian package listings, but I
couldn't find any documentation. The name also doesn't appear in Exim's
source code (according to GitHub search).

Is there some explanation about this? Does it work? What does it do?
Should I create the mentioned file if I don't have it yet?

-Yves

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Hide IP address of authenticated users [ In reply to ]
Yves Goergen via Exim-users wrote on 15.03.2023 00:02:
> Hello,

Hello

> I'd like to hide the IP address of authenticated users sending their
> messages over my SMTP server. The address always appears in the
> "Received" header and remains there for the final recipient.

You may set the value of received_header_text depending on
$authenticated_id.


> A web search has only led to this information:
>
> https://serverfault.com/questions/1035035/remove-ip-and-username-from-exim-mail-headers
>
>
> I couldn't find any information about the suggested solution. That
> all-caps name is mentioned in very long Debian package listings, but I
> couldn't find any documentation. The name also doesn't appear in Exim's
> source code (according to GitHub search).
>
> Is there some explanation about this? Does it work? What does it do?
> Should I create the mentioned file if I don't have it yet?
>
> -Yves
>


--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Hide IP address of authenticated users [ In reply to ]
On 14/03/2023 22:02, Yves Goergen via Exim-users wrote:
> Is there some explanation about this? Does it work? What does it do? Should I create the mentioned file if I don't have it yet?

It's a macro definition, in Exim terms. What having it defined means
depends on the rest of the configuration; it's in no way a builtin
thing for Exim. You need to investigate the configuration that it
is intended to be used with, and _its_ documentation.

Possibly Debian's.
--
Cheers,
Jeremy


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Hide IP address of authenticated users [ In reply to ]
Hi Yves,

On 14.03.23 23:02, Yves Goergen via Exim-users wrote:
> I'd like to hide the IP address of authenticated users sending their messages over my SMTP server. The address always appears in the "Received" header and remains there for the final recipient.

You can remove headers in router or transport, see https://www.exim.org/exim-html-current/doc/html/spec_html/ch-generic_options_for_routers.html and
https://www.exim.org/exim-html-current/doc/html/spec_html/ch-generic_options_for_transports.html for a reference.

Depending on your config the remote_smtp router might be a good one to remove all headers. I use that transport (and some others that handle mail to external servers) to remove some internal
headers.

hth,
Thomas

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Hide IP address of authenticated users [ In reply to ]
D?a 14. marca 2023 22:02:24 UTC používate? Yves Goergen via Exim-users <exim-users@exim.org> napísal:

>I couldn't find any information about the suggested solution. That all-caps name is mentioned in very long Debian package listings, but I couldn't find any documentation. The name also doesn't appear in Exim's source code (according to GitHub search).

These debian's macros are documented only in config's
comments, but not all.

When you wil search in config, you will find that these
macros are used either for conditional in/exclude some
sections or as option values. Find that option and then
look in exim's docs for its value syntax.

Then define that value for macro:

MACRO = value

Where to define it, depends on used config type --
split or not split. That is documented somewhere, i
forgot where ;-)

regards


--
Slavko
https://www.slavino.sk/

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Hide IP address of authenticated users [ In reply to ]
On 2023-03-14, Yves Goergen via Exim-users <exim-users@exim.org> wrote:
> Hello,
>
> I'd like to hide the IP address of authenticated users sending their
> messages over my SMTP server. The address always appears in the
> "Received" header and remains there for the final recipient.
>
> A web search has only led to this information:
>
> https://serverfault.com/questions/1035035/remove-ip-and-username-from-exim-mail-headers
>
> I couldn't find any information about the suggested solution. That
> all-caps name is mentioned in very long Debian package listings, but I
> couldn't find any documentation. The name also doesn't appear in Exim's
> source code (according to GitHub search).
>
> Is there some explanation about this? Does it work? What does it do?
> Should I create the mentioned file if I don't have it yet?

Yes, that is an addition provided by the exim configuration system used
by debian.


I use the following:

received_header_text = Received: \
${if def:sender_rcvhost {from \
${if bool{$acl_m_mangle_received}{\
${sg{$sender_rcvhost}{\\[(\\d+\\.\\d+\\.\\d+)\\.\\d+\\]}{[10.\$1]}}\
}{$sender_rcvhost}}\n\t}\
{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}\
${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
by $primary_hostname ${if def:received_protocol {with $received_protocol}} \
${if def:tls_cipher {($tls_cipher)\n\t}}(Exim $version_number)\n\t\
${if def:sender_address {(envelope-from <$sender_address>)\n\t}}\
id $message_exim_id${if def:received_for {\n\tfor $received_for}}


Where "$acl_m_mangle_received" is a variable set in the mail ACL

This expression conditionally rewites the client ip address a.b.c.d to look like a
LAN address 10.a.b.c

This is enough to satify Spamassassin (which wants to see a received
header) and Barracuda Networks (who take objection to cetrain ip
addresses appearing in received headers)

--
Jasen.
???????? ????? ???????

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Hide IP address of authenticated users [ In reply to ]
On Wed, 15 Mar 2023, Jasen Betts via Exim-users wrote:

> On 2023-03-14, Yves Goergen via Exim-users <exim-users@exim.org> wrote:
>> Hello,
>>
>> I'd like to hide the IP address of authenticated users sending their
>> messages over my SMTP server. The address always appears in the
>> "Received" header and remains there for the final recipient.
... ...
> This expression conditionally rewites the client ip address a.b.c.d to look like a
> LAN address 10.a.b.c
>
> This is enough to satify Spamassassin (which wants to see a received
> header) and Barracuda Networks (who take objection to cetrain ip
> addresses appearing in received headers)

Nice, but there is still a lot of information in a.b.c
for anyone who knows the trick.

I guess it is time to add an ipv6 equivalent ?


> --
> Jasen.
> ???????? ????? ???????
!!!

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/