Gmail – Can you search Gmail based on sender’s IP address

email-headersgmailgmail-search

Someone is trying to fool me. They are sending mails to me and I'm pretty sure it is someone I know.

Via "Show original message" I found the IP address of the sender. With the assumption it is someone I know (he/she is just using another email account) I assume he/she has sent me other mails under his normal account.

In this case the IP address of the PC will be the same.

Unfortunately it is not easy to go through more than 500K mails and see if the IP address is the same.

The search of Gmail does not search the headers. Is there a way to search all mails received in Gmail for a particular IP address?

Best Answer

Perhaps Gmail doesn't let you search the email headers from their web interface, but you should be able to access all email messages via POP/IMAP, and then you can use standard search tools (e.g. grep) to search for anything you want.

However, see the comment above from Ramhound and myself—the email headers might lead you back to Gmail itself, which won't reveal much about the originator of the email. Also, all headers are easy to forge anyway. If the user is clever enough, they can generate whichever headers / source IPs they want.

If in your case the user you're trying to spy on / trace isn't malicious, then you might be able to get at least some information other than the message content from email headers.