Self-hosted email leaks home IP address
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@bclug.ca>; Sat, 7 Mar 2026 20:39:30 -0500 (EST) from=<canto_telnet@maow.net> to=<cc@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
On 2026-03-10 16:00, Ron via Talk wrote:
Anyone running Postfix to self-host email and notice that their home IP address is leaked in the first "Received: from" header? Postfix is a Mail Transfer Agent. By rights it always needs to include where the message came from. If you inject the message directly into the postfix delivery queue without coming through the SMTP/SUBMISSION interfaces then you should have no first received-from header.
That is kind of what gmail is doing. If you send a message through google from Thunderbird (in my case) they include the source address of my firewall. As for security. That is a double edged sword. Including the address of the source workstation can be important if you need to find out who physically sent the email. Lets say I use your email account to send out company secrets from my workstation. Without that first IP address it would end up with the wrong person being accused. In general knowing an un-routable 10. network address will not provide much information to a hacker unless they can get inside your network. [snip] -- Alvin Starr || land: (647)478-6285 Netvel Inc. || home: (905)513-7688 alvin@netvel.net ||
participants (2)
-
Alvin Starr -
Ron