I've noticed that sometimes when I use Gmail's web interface to send an email, it includes the X-Originating-IP: header, and sometimes it doesn't.

When does Gmail decide to include the X-Originating-IP header in outgoing email and when does it not?

3 Answers 3


According to the documentation, they may include the sender IP.

IP addresses can be considered sensitive information. As such, Gmail may hide sender IP address information from outgoing mail headers in some circumstances.

I've experimented with it a bit, and I think it works like this:

  • For generic gmail addresses (@gmail.com, @googlemail.com), gmail does not include the X-Originating-IP header.
  • For messages sent using a Google Apps domain (@customdomain.tld), gmail always includes the X-Originating-IP header.

There are a few situations I couldn't test, though. Its possible that gmail adds the X-Originating-IP header when an e-mail is sent using an IP address that never accessed your account before.

  • I heard that they also include the original IP address when you use a mail client on your PC (and send via gmail's SMTP). Commented Jun 24, 2015 at 2:50
  • I'm using Google Apps with my domain, and I can confirm that ALL of my sent mail include my client IP address attached as a 'X-Originating-IP' email header. All of my sent mail contains this. Commented Sep 29, 2016 at 23:04

I'll assume you're talking about received emails - and not Gmail randomly appending the header when you send emails through the web interface.

The X-Originating-IP header is a "custom" header, in that it's not identified as a required field that all emails contain (compared to To, From, etc.).

Many email programs and web-based mail services such as Hotmail (Windows Live), Gmail, and Yahoo! Mail, append it and various other headers depending on how they were programmed. In the case of emails being sent from Hotmail or Gmail, it tracks the IP address of the computer the sender sent the email from.

It's been reported - but not confirmed - that those headers are used by the web-based email services to blacklist the IP address of computers that send an overwhelming amount of spam. You may also notice the X-Originating-Email: header as well, which can also be appended by those services at times. This also helps to track down email spoofing, etc., on such services.

In the case of why you don't always see it - check to see what client the sender was using. Chances are it won't be a Gmail or Hotmail address - but another client that doesn't append the optional header, since it doesn't need to be used to deliver the actual message.

If you're looking to use the X-Originating-IP header for filtering, you may have better luck with the Received header, which may also contain the IP address.

One thing to note, is just like any other header, the X-Originating-IP header can be easily faked.

  • 1
    I'm talking about outgoing email. I'll rephrase the question to clarify...
    – Senseful
    Commented Sep 23, 2010 at 3:54

Typically, the X-Originating-IP header is omitted if one uses the Gmail app to send the message

Reference: Email Headers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.