Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6207513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:38:34+00:00 2026-05-24T05:38:34+00:00

I’m building a email app (a web app which you interact with almost exclusively

  • 0

I’m building a email app (a web app which you interact with almost exclusively by email) and I’d like to be able to take a reasonable guess as to where my users are from using only their email headers. (I’m a firm believer that ‘defaults’ in web services should be as intelligent as possible!)

Does anyone with decent knowledge of modern email routing (ie. super-providers like google, yahoo etc) have any good ideas as to how to pull a user’s country from an email with a reasonable amount of accuracy and, if possible, a rough indication of how accurate this would be, so I can disregard the guess if it’s unlikely to be correct?

Ideas so far:

  • Timezone (nowhere near accurate enough, but useful)
  • email domain TLD (not very reliable, I have a .com TLD and I’m British)
  • GeoIP of IPs in email header (not really sure whether this would work, which header would be the most reliable?)

Thanks for your head-cycles!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:38:35+00:00Added an answer on May 24, 2026 at 5:38 am

    “normal” mail

    I once wrote a thunderbird plugin which does the same and it exclusively used the top level domains to display the station of each route. A lesson learned there is that the mail may go over 10 or more servers until it reaches the recipient. You have to use the first route entry:

    Received: by mail.cweiske.de (Postfix, from userid 65534)
        id 1DB83119102DA; Sat, 30 Jul 2011 13:58:30 +0200 (CEST)
    Received: from fmmailgate02.web.de (fmmailgate02.web.de [217.72.192.227])
        by mail.cweiske.de (Postfix) with ESMTP id D56F6119102D3
        for <me@example.orge>; Sat, 30 Jul 2011 13:58:18 +0200 (CEST)
    Received: from smtp03.web.de  ( [172.20.0.65])
        by fmmailgate02.web.de (Postfix) with ESMTP id E54B11A74B6A1
        for <me@example.org>; Sat, 30 Jul 2011 13:57:52 +0200 (CEST)
    Received: from [84.185.130.22] (helo=[192.168.178.21])
        by smtp03.web.de with asmtp (WEB.DE 4.110 #2)
        id 1Qn88O-0006jw-00
        for me@example.org; Sat, 30 Jul 2011 13:55:14 +0200
    

    In that case, the sender is 84.185.130.22 – a whois on that IP gives us (correctly) Germany as the source of the mail.

    Another example, first entry only:

    Received: from carnot.localnet (ip-118-90-104-106.xdsl.xnet.co.nz
    [118.90.104.106])
    by ananke.wxnz.net (Postfix) with ESMTP id D758D17002B
    for <me@lists.sourceforge.net>;
    Sun, 31 Jul 2011 10:08:57 +1200 (NZST)
    

    which even contains .nz as resolved hostname – this time correctly New Zealand. whois also gives you new zealand.

    webmail

    You’d have to check if mails from i.e. gmail web interface also contain the correct IP, which I doubt. An example from gmail:

    Received: from mail-wy0-f179.google.com (mail-wy0-f179.google.com [74.125.82.179])
        by mail.cweiske.de (Postfix) with ESMTP id A739A11910543
        for <me@example.org>; Wed, 23 Jun 2010 23:05:42 +0200 (CEST)
    Received: by wyb38 with SMTP id 38so1740851wyb.24
            for <me@example.org>; Wed, 23 Jun 2010 14:05:42 -0700 (PDT)
    

    The sender IP is totally missing here, and the only information you get is the IP from google’s mail server. The time zone there is also the zone of the server, not the client’s time zone – it would be +02:00.

    conclusion

    In the end, no signal gives you 100% accuracy and you have to employ all of them.
    Also, every single bit in an email may be forged – don’t forget that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.