Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm exchanging emails with a number of different users - is it possible to look at the mail headers and figure out if those users are using Google Apps as the mail server?

share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

Dig their MX records:

$> dig domainname.com mx

If they're with Google, you'll know it.

domainname.com.            2198    IN      MX      10 ASPMX.L.GOOGLE.com.
domainname.com.            2198    IN      MX      20 ALT1.ASPMX.L.GOOGLE.com.
domainname.com.            2198    IN      MX      20 ALT2.ASPMX.L.GOOGLE.com.
domainname.com.            2198    IN      MX      30 ASPMX2.GOOGLEMAIL.com.
domainname.com.            2198    IN      MX      30 ASPMX3.GOOGLEMAIL.com.
domainname.com.            2198    IN      MX      30 ASPMX4.GOOGLEMAIL.com.
domainname.com.            2198    IN      MX      30 ASPMX5.GOOGLEMAIL.com.
share|improve this answer
1  
For windows see members.shaw.ca/nicholas.fong/dig –  harrymc Nov 5 '10 at 15:30
    
Thanks, @harrymc. –  user3463 Nov 5 '10 at 15:30
1  
Also you could use samspade.org. –  CarlF Nov 5 '10 at 15:33
add comment

If you are using .NET, and make the assumption that their domain is MAIL.theirdomain.com, you can do this:

System.Net.Dns.GetHostEntry("mail.theirdomain.com").HostName

Google Apps accounts that I've seen all end with google.com, such as ghs.google.com.

Paul

share|improve this answer
    
Writing a program to perform a DNS query with tons of existing tools seems like an overkill... –  Matteo Apr 15 '12 at 15:26
    
@Matteo this could be used in PowerShell, which comes with Windows Vista and newer... –  Bob Apr 15 '12 at 15:50
2  
That might appear to work, kind of - except when it won't. Many domains have a 3rd-level wildcard for A records - mail.example.com would point to the same host as xyzzy.example.com and foobar.example.com. It is better to check the actual MX record (see the accepted answer) than to guess. On half the domains I've set up with Google Apps, your method would mistakenly return "false", as the web access was not on mail.example.org. For example, this is a valid way to login: google.com/a/example.com/ServiceLogin?service=mail –  Piskvor Apr 15 '12 at 16:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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