Batch checking the existence of gmail accounts

When you try to register a gmail account, you most probably found all the usernames you desired have been taken.

So, a good tool for batch checking the available mailboxes becomes attractive.

Here I show a method used by myself. It’s a simple perl script:

#!/usr/bin/perl 

 use strict;
 use Gmail::Mailbox::Validate;
 
 my $username = shift || die "$0 username\n";
  
 my $v = Gmail::Mailbox::Validate->new();
 print "$username mailbox exists\n" if $v->validate($username); 

Given the username, this script will tell you if this mailbox at google exists.

For example:

$ ./gmbox wesley9807
 wesley9807 mailbox exists

$ ./gmbox wesley98076
 

The first one tell you username “wesley9807” exists. The second one returns nothing, that username may not be registered. So, you may have the chance to register the username “wesley98076”.

Please notice: The second command returns nothing, it does mean this username has no mailbox at google. But, it still does not mean you can take this username.

For example, google seems keep some good usernames, which have no mailboxes, but you can’t register for them. And, a google user may choose to delete his/her mailbox, but keep the other google service running (google drive etc), so you can not register this mailbox too.

Anyway with this method you can check a lot of usernames quickly. There is no need to try them one by one from google’s registration page.

How to install the required perl module? just use cpanm tool. For example:

$ sudo cpanm Gmail::Mailbox::Validate
 Gmail::Mailbox::Validate is up to date. (0.01) 

The last, you should not abuse it, otherwise google may block your IP or networks.