How come the machine name shows up in the email header?

4

All of the mails I send out arrive with the following header:

Received: from My-iMac (12.12.12.12 [12.12.12.12]) by mx.mail.com

How come my machine name My-iMac shows up? Is it because of my mail client (Airmail) or is that the result of some resolution? Is there a simple way to hide my hostname?

Thanks

Kar

Posted 2014-12-20T14:43:10.467

Reputation: 173

Answers

2

When host initiate an SMTP session it have to send HELO/EHLO request. That request contains hostname as host know it. In your case there is My-iMac.

Here the quote from the wikipedia:

S: 220 smtp.example.com ESMTP Postfix
C: HELO relay.example.org
S: 250 Hello relay.example.org, I am glad to meet you
C: MAIL FROM:<bob@example.org>
S: 250 Ok
C: RCPT TO:<alice@example.com>
S: 250 Ok
C: RCPT TO:<theboss@example.com>
S: 250 Ok
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C: From: "Bob Example" <bob@example.org>
C: To: "Alice Example" <alice@example.com>
C: Cc: theboss@example.com
C: Date: Tue, 15 January 2008 16:02:43 -0500
C: Subject: Test message
C:
C: Hello Alice.
C: This is a test message with 5 header fields and 4 lines in the message body.
C: Your friend,
C: Bob
C: .
S: 250 Ok: queued as 12345
C: QUIT
S: 221 Bye
{The server closes the connection}

Little advise: you definitely shouldn't use IP addresses 12.12.12.12 or else. Allowed for private use ranges are: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

Kondybas

Posted 2014-12-20T14:43:10.467

Reputation: 499

When the client is behind a NAT/Router the IP address is the external IP address. – marsh-wiggle – 2014-12-20T15:08:50.963

Oh, I've thought you have copypasted asis... – Kondybas – 2014-12-20T15:16:11.400

Sorry, 12.12.12.12 was just a dummy external IP. Is there a way to not show my machine name? I guess, to somehow disallow my host resolving it (or just for emails, if possible)? – Kar – 2014-12-20T15:31:17.967

1In short - you can't. Providing your hostname is mandatory and most SMTP-servers checks whether it is real. If no - they think that sender is a spammer. Some servers can allow to use fake hostname if authorization passed but that is not an usual behaviour. – Kondybas – 2014-12-20T15:39:12.453

@Kondybas how can a mail server check if the hostname in a private network behind natting is correct? – marsh-wiggle – 2014-12-20T15:59:14.923

In your case probably it just know that your real IP-address is in the ISP's dynamic range and doesn't perform further checks. But in the message headers it place the name your host provided as HELO – Kondybas – 2014-12-20T16:14:30.160

Of course you can't hide the data from the sending server, but that doesn't seem to be what the question is about. It is asking for a way to not have the headers revealing personal information, which likely also includes client software versions and other data that is better kept private, not be included when sending mail to other servers. – Paul – 2014-12-20T17:57:31.850

1

The client sends its hostname (computername) to the mail server (smtp). The mail server loggs the public IP where it gets the mail from and, after a reverse lookup, also the complete name.

Your mail provider has to note the external IP in the header but needs not to note your computername.

In Airmail seems to be no way to spoof the senders hostname.

marsh-wiggle

Posted 2014-12-20T14:43:10.467

Reputation: 2 357

Do you know how I could hide my hostname? I'd prefer to not show my hostname to every email recipient. – Kar – 2014-12-20T15:35:23.160

1No, I don't know an easy way without setting up an own mail server like postfix. Maybe that there are mail clients that suppress it or mail providers that don't send it. – marsh-wiggle – 2014-12-20T15:50:01.760

0

Assuming that header is from an email sent by a user on a mail.com account, I would say this is caused by a poorly configured mail server. The server should strip out a number of headers that reveal information about clients. The only way I'm a aware of to fix this would be to check if the same information is revealed using the webmail interface, and if not, then use that, or use a mail provider that strips the headers.

Despite the comments below regarding possible violations of RFC 5321 6.4 by Google and thousands of others, the solution I suggest will provide the results the question seems to be seeking.

The downvotes on this answer and the poor comments below, as well as pseudo answers above that are voted up are why I rarely venture into SU. So far as I can tell, I have the only answer here that offers a solution to the problem described in the question.

Paul

Posted 2014-12-20T14:43:10.467

Reputation: 698

Why should it strip out information that can be used to e.g. find spammers, figure out deliverability problems or otherwise be of use to sysadmins? – Jenny D – 2014-12-20T16:48:53.953

@JennyD It is not necessary to include such information in the outgoing email headers. Take a look at an email sent from Gmail. I configure all my mail servers this way. It is pretty much standard for most admins. – Paul – 2014-12-20T16:52:33.497

Gmail has internal logs giving them the ability to trace messages while munging the headers. And it still causes problems for other sysadmins when their users misbehave. Munging information like that breaks the RFCs and should be discouraged. (Speaking as a sysadmin who started managing email nearly 20 years ago...) – Jenny D – 2014-12-20T16:55:41.660

@JennyD Which RFC states that client information must communicated to receiving MTA? My understanding is that only such data on the sending MTA is required. Again, take a look at an email sent via SMTP client through Gmail. Is Google violating the RFC? – Paul – 2014-12-20T16:59:12.237

RFC5321: As discussed in Section 6.4, a relay SMTP has no need to inspect or act upon the header section or body of the message data and MUST NOT do so except to add its own "Received:" header field – Jenny D – 2014-12-20T17:03:18.480

@JennyD Please walk through the steps of sending an email from Outlook using Gmail and explain where Google is violating this RFC. – Paul – 2014-12-20T17:07:26.750

@JennyD I cannot find the quote you provide in your comment. There is a similar statement for intermediate servers, but this appears to be a discussion separate from the discussions on originating SMTP servers. There is also a discussion on authentication exceptions for clients. Additionally, I would be curious to know about other discussions on this RFC as what you suggest requires providing client data that may tell others of specific insecure configurations, such as an older software version of a client, or simply a software that an attacker has a vulnerability for. – Paul – 2014-12-20T18:04:24.763

Paul, I don't know enough about the subject matter to have an opinion. However, the purpose of SU is to compile questions and answers for future reference (with most queries originating externally). People searching should find clean questions and answers focused on the subject. Meta information and commentary about the site, the Q&A process, or quality judgements on other answers should be done in comments (or on the Meta site), rather than in the answer (or question). Your answer could get downvotes for that, irrespective of subject content. Consider moving that to comments. – fixer1234 – 2014-12-20T19:27:11.340

@JennyD You may want to review http://tools.ietf.org/html/rfc6409. I do not believe Google nor the many others are violating IETF RFCs on this matter. I do not appreciate your using an SE discussion for solicitation of services. Additionally, the way you present your argument is as if you have no reason to back up your claim. You could have stated, "I do not use Outlook, but I do use..."

– Paul – 2014-12-20T19:50:27.483

@fixer1234 Unfortunately, most Internet communities that have site discussion forums will have those forums populated with fanboyz that give default preference to those who have the most Internet Points, so I very, very rarely bother posting there. – Paul – 2014-12-20T20:08:39.453

@JennyD Thank you for your resolution to remain in professional forums so that you can be corrected by people who know what they are discussing, as you seem to not be familiar with an important RFC on mail sending and by coming here pretending to know more than you do you have likely confused those who are not familiar with the topic. – Paul – 2014-12-20T20:45:36.220

@JennyD & Paul - Come on, people. None of what is posted should be personal. Please just stick to the question asked and factual answers. People can disagree in a respectful way. Just state your information. The fact that conflicting information has been presented will lead readers to do their own research or to ask additional questions for clarification. – fixer1234 – 2014-12-20T20:55:47.447

Paul, regarding your observation about preference being given to those with the most rep, that's actually the basis for this site. It's true that sometimes the person with a lot of rep will be wrong and the person with little rep will be right. It happens on some questions. People accumulate rep from being right most of the time. The system isn't perfect and your answer on a specific question may not get recognized. If you stick around and keep answering questions, you will accumulate your own rep and then people will complain about you when they think your answer is wrong. :-) – fixer1234 – 2014-12-20T21:06:36.637