require "email_homepage/version" module EmailHomepage def self.get email_address return nil unless email_address.match /^.+@.+$/ email_address.downcase! if (email_address.match /@qq.com/) || (email_address.match /@foxmail.com/) return "http://mail.qq.com" elsif email_address.match /@163.com/ return "http://mail.163.com" elsif email_address.match /@vip.163.com/ return "http://vip.163.com" elsif email_address.match /@126.com/ return "http://mail.126.com" elsif email_address.match /@gmail.com/ return "http://mail.google.com" elsif email_address.match /@sohu.com/ return "http://mail.sohu.com" elsif (email_address.match /@sina.com.cn/) || (email_address.match /@sina.com/) return "http://mail.sina.com.cn" elsif email_address.match /@vip.sina.com/ return "http://vip.sina.com" elsif email_address.match /@aliyun.com/ return "https://mail.aliyun.com/" elsif email_address.match /@yahoo.com/ return "http://mail.yahoo.com" elsif email_address.match /@tom.com/ return "http://tom.com" elsif email_address.match /@yeah.net/ return "http://yeah.net" elsif email_address.match /@21cn.com/ return "http://mail.21cn.com" elsif (email_address.match /@hotmail.com/) || (email_address.match /@outlook.com/) || (email_address.match /@live.com/) return "http://outlook.office.com" elsif email_address.match /@sogou.com/ return "http://mail.sogou.com" elsif email_address.match /@188.com/ return "http://www.188.com" elsif email_address.match /@139.com/ return "http://mail.10086.cn/" elsif email_address.match /@189.cn/ return "http://webmail30.189.cn/w2/" elsif email_address.match /@zoho.com/ return "https://www.zoho.com.cn/mail/" else domain_name = email_address.split(/@/).last host_name = `host #{domain_name} | grep mail | awk 'NR==1{print $7}'` if host_name.match /qq.com/ return "http://exmail.qq.com/login" elsif (host_name.match /163.com/) || (host_name.match /netease.com/) return "http://ym.163.com/" elsif (host_name.match /google.com/) || (host_name.match /googlemail.com/) return "https://www.google.com/intl/zh-CN/mail/help/work.html" elsif (host_name.match /outlook.com/) || (email_address.match /@hotmail.com/) || (email_address.match /@live.com/) return "http://outlook.office.com" elsif host_name.match /aliyun.com/ return "https://mail.aliyun.com/" elsif host_name.match /sina.net/ return "http://mail.sina.net/" elsif host_name.match /zoho.com/ return "https://www.zoho.com.cn/mail/" elsif host_name.match /sohu.net/ return "http://mail.sohu.net/" elsif host_name.match /21cn.com/ return "http://exmail.189.cn/" else return nil end end end end