2

I'd like to link my users directly to the appropriate webmail provider, based on their email addresses (e.g. link my "@gmail.com" users to Gmail). Is there a standard way of doing this? Preferably a Ruby gem. I don't mind being the one to make it--but I don't want to duplicate effort if it exists and I just haven't found it.

This is related to How do I identify a webmail service from an email address?.

Community
  • 1
  • 1
XZVASFD
  • 1,040
  • 1
  • 11
  • 12

1 Answers1

0

You could do some gross redirection based on the mail box's hostname's DNS MX record.

e.g.

$mx = array();
getmxrr('gmail.com', $mx)

should return something like

Array
(
    [0] => alt2.gmail-smtp-in.l.google.com
    [1] => alt1.gmail-smtp-in.l.google.com
    [2] => gmail-smtp-in.l.google.com
    [3] => alt4.gmail-smtp-in.l.google.com
    [4] => alt3.gmail-smtp-in.l.google.com
)

From which you could identify who the provider is. But that presumes they're not hiding their name via further aliases and whatnot.

Marc B
  • 356,200
  • 43
  • 426
  • 500