Another frequently asked question about SMTP mail – how can I remove internal host names and IP addresses from outbound Internet mail? More often than not, this results from the belief that somehow if the outside world finds out an organization’s internal IP addresses and host names, it makes the organization vulnerable. Auditors love to point this out for some reason. Perhaps it’s a part of an IT audit checklist written by a security expert at some law firm somewhere and given the viral nature of checklists it’s all over the place!
Let’s take a look at what we’re talking about here. As a message makes its way from one server to another, it may be handled by more than one SMTP hosts. Each host adds a RECEIVED header at the beginning of message headers, leaving a trace of where the message has been and when (a timestamp).
Here are headers from a message received from Dell. (Unnecessary headers removed).
Received: from smtp.easydns.com (126.96.36.199) by exchange.somedomain.com
(192.168.2.171) with Microsoft SMTP Server id 188.8.131.52; Mon, 19 May 2008
Received: from mh.dell.m0.net (mh.dell.m0.net [184.108.40.206]) by
smtp.easydns.com (Postfix) with ESMTP id 647C222914 for <me>;
Mon, 19 May 2008 06:14:46 -0400 (EDT)
Received: from [192.168.138.130] ([192.168.138.130:57330]
helo=fc13a1.dc1.prod) by oms1.dc1.prod (ecelerity 220.127.116.11 r(19486)) with
ESMTP id 3B/AF-18306-11351384 for <me>; Mon, 19 May 2008
Message-ID: <[email protected]>
Date: Mon, 19 May 2008 03:14:41 -0700
From: Dell Small Business <dell>
Subject: $429 desktop, plus new laptops. Hurry and shop now.
Errors-To: [email protected]
Return-Path: [email protected]
These headers can be used to determine the path taken by a message— useful information for troubleshooting and preventing message loops.
What the standards say
Let’s take a look at what the standards say. RFC 2821 says (capitalization of words as it appears in the RFC, emphasis added):
4.4 Trace Information
When an SMTP server receives a message for delivery or further processing, it MUST insert trace (“time stamp” or “Received”) information at the beginning of the message content, as discussed in section 18.104.22.168.
This line MUST be structured as follows:
– The FROM field, which MUST be supplied in an SMTP environment, SHOULD contain both (1) the name of the source host as presented in the EHLO command and (2) an address literal containing the IP address of the source, determined from the TCP connection.
and prohibits removing received headers (repeatedly). One example:
An Internet mail program MUST NOT change a Received: line that was previously added to the message header. SMTP servers MUST prepend Received lines to messages; they MUST NOT change the order of existing lines or insert Received lines in any other location.
Is it really more secure?
Should you remove these Received headers and “hide” internal hosts and IP addresses? Are they really a security risk?
There are many opinions about security through obscurity, but if your security relies on hiding internal hostnames and IP addresses, you probably have other things to worry about.
Steve Riley, Senior Security Strategist at Microsoft, says:
In general, you can’t achieve any additional security by trying to hide things that weren’t designed to be hidden. IP addresses, wireless SSIDs, hostnames—these are all identifiers, and by definition, an identifier is intended to be known. Efforts to hide them generally fail, because the thing that the identifier points to still exists! Determined attackers will find the thing regardless of what you name it.
Microsoft does not remove internal message routing headers. Nor do Dell (as the message headers in the example above reveal), HP, and many other large organizations.
In many ways, the issues faced are similar to changing fqdn on SMTP Virtual Server/Receive Connector. Even if you make these changes in order to mask the internal hostname of a server, at least one internal hostname is likely to be revealed by the Message-ID (read “Masquerading SMTP Virtual Servers: Changing the fqdn and masquerade domain“).
Nevertheless, many organizations may have a legitimate need to cleanse outbound mail of internal host names and IP addresses, and you probably don’t want to invite adverse remarks in an IT or compliance audit (should you find such a requirement on the auditor’s checklist).
How to remove Received headers in Exchange Server 2007/2010
Exchange 2007/2010 offers an easy way to accomplish this. If your transport server sends outbound email directly using DNS lookup, or delivers to a smarthost without authentication, simply remove the Ms-Exch-Send-Headers-Routing permission assigned to Anonymous Logon — a well-known security principal that refers to anonymous users, as shown below:
Get-SendConnector “Connector Name” | Remove-ADPermission -AccessRight ExtendedRight -ExtendedRights ms-Exch-Send-Headers-Routing -user “NT AUTHORITY\Anonymous Logon”
What’s your take?
Does your organization remove internal Received headers? What are the reasons cited? Does removing internal received headers make your organization more secure? Feel free to leave a comment and share your opinion about this.