[kwlug-disc] Self-hosted email leaks home IP address
Ron
ron at bclug.ca
Tue Mar 10 16:00:14 EDT 2026
Anyone running Postfix to self-host email and notice that their home IP
address is leaked in the first "Received: from" header?
If you haven't noticed, send yourself a message and check if it's happening.
If you have noticed, do you care? What have you done to prevent it?
If you don't self-host, are you still leaking your home IP? Gmail seems
to remove this first header, so in some sense more privacy via Gmail
than self-hosting.
I've got a temp work-around via header_checks:
`apt install postfix-pcre`
main.cf:
--------
header_checks = /etc/postfix/header_checks.pcre
/etc/postfix/header_checks.pcre:
--------------------------------
## WORKS for some messages, not all (this one has ?? delimters - telnet?):
/^(Received: from ).*\([0-9\.\-]+cable.teksavvy.com.*\)(.*by .*) from .*
(.*)$/AU REPLACE ${1}***ISP name hidden*** ${2} ${3}
/^(Received: from ).*\([0-9\.\-]+cable.teksavvy.com.*\)(.*by .*)$/AU
REPLACE ${1}***ISP name hidden*** ${2}
NOTE: for testing header_checks.pcre, postmap does *not* create a DB and
will throw an error if trying to do that like one does with a hash map.
Just test by copying an offending header to a script and run it with:
postmap -vq "Received: from ..."
And the output (of mine) should show:
REPLACE Received: from ***ISP name hidden*** ??by mail.bclug.ca
(Postfix) with SMTP id 09F5081D15??for <cc at bclug.ca>; Sat, 7 Mar 2026
20:39:30 -0500 (EST) from=<canto_telnet at maow.net> to=<cc at bclug.ca>
proto=SMTP helo=<bclug.ca>
NOTE: Thunderbird can be configured to set the elho to
ehlo.thunderbird.net, which Android client does by default, I believe.
https://support.mozilla.org/en-US/kb/thunderbird-smtp-ehlo
In the config editor, add or change this key:
mail.smtpserver.default.hello_argument
to value:
ehlo.thunderbird.net
More information about the kwlug-disc
mailing list