SQL to see domains for email addresses

I wanted to find out which domains were on somebody’s mailing list, and used this SQL command:

SELECT count((SUBSTRING_INDEX(SUBSTR(email, INSTR(email, ‘@’) + 1),’.’,1))), (SUBSTRING_INDEX(SUBSTR(email, INSTR(email, ‘@’) + 1),’.’,1)) FROM `phplist_user_user` group by (SUBSTRING_INDEX(SUBSTR(email, INSTR(email, ‘@’) + 1),’.’,1)) where confirmed=1 and blacklisted=0 order by count(SUBSTRING_INDEX(SUBSTR(email, INSTR(email, ‘@’) + 1),’.’,1)) desc

It resulted in this list. Pretty cool!

3916 gmail
496 yahoo
442 kellyservices
256 comcast
228 hotmail
195 officeteam
179 accountemps
163 aol
115 sbcglobal
85 volt
84 att
81 adeccona
78 bellsouth
76 outlook
76 roberthalffinance
65 us
58 roberthalftechnology
57 earthlink
56 me
56 msn
53 ajilonfinance
52 roberthalfmr
51 cox
47 right
43 mail
40 icloud
40 mac

Testing DKIM

Recently, I’ve been learning about email and how to set things up so people can’t impersonate email addresses.

One of the things to set up is DKIM, which is a method of “signing” an email as it leaves your server. The recipient end can validate that signature when email is received, and if it fails the validation, the email can be rejected as not legitimate.

This site can be used to test if your DKIM signature is set up correctly:

http://www.appmaildev.com/en/dkim

Another way to test is to send it to your Yahoo email, then look at the message source. If you find “dkim=pass” in the header, you’re good to go.

And, one more way is to send an email to check-auth@verifier.port25.com and you’ll get a report back.

Additional resource: https://emailstuff.org/

Nifty!