[Guide] Step by Step - Use Gmail as a catchall email + A mini script

hideath

Elite Member
Joined
Jun 16, 2019
Messages
6,620
Reaction score
7,370
So, whenever you're tying to creating multiple accounts in some platform,
You'll need to buy/create a shit ton of emails sometimes,
But you could actually use a single Gmail account for that exact purpose without any need for more

Here's what to do:
  • Create or use a Gmail account with at least 15 chars username,
    This can be anything random, it doesn't really matter, take for example "[email protected]",
    This one got 21 chars and it's usually more than enough to generate your emails
Enabling IMAP
  • Now to use this Gmail, you'll have to enable IMAP or POP, both work good, but i personally prefer IMAP,
    For that, first click the setting icon in the top right:
    1699690435271.png
  • Next, click on "See all settings"
    1699690469307.png
  • Go to "Forwarding and POP/IMAP"
    1699690515393.png
  • Click on "Enable IMAP"
    1699690558884.png
  • Leave the rest of options as they are, then click "Save changes"
Enabling 2FA
  • Now, in order for IMAP to work, we need to enable "2fa", that will require you a phone number or simply download backup codes,
    Go to https://myaccount.google.com/signinoptions/two-step-verification/enroll-welcome
  • Click "Get Started"
  • There will be only option to use a phone number, but while adding a new one, click on "Use another backup option"
    1699690979305.png
  • Make sure to download the codes if you don't have (or added) phone number
  • Next confirm with "I have my backup codes" or confirm your phone number
Generating an App Password
  • Now, we need to generate a new App Password, for that go to https://myaccount.google.com/apppasswords
  • Name your app with whatever name you see suitable
    1699691406596.png
  • Then click on create
  • Your App password will show up, make sure to save it somewhere as you won't have access after clicking "Done"
Using Gmail IMAP
Now, in order to use the Gmail IMAP, you'll have to use the following settings:
  • IMAP Host: imap.gmail.com
  • IMAP Port: 993
  • Encryption: ON (SSL)
  • IMAP Username: your Gmail address, in our example it's [email protected]
  • IMAP Password: The App Password that you got earlier

Generate different Gmail Emails
Now for the catchall to work, there are several variations of your email that you can use and they'll be redirected to your main Gmail account,
The first example would be to add dots between the characters, for example if your Gmail is "[email protected]", you can use "[email protected]", "[email protected]", etc...
For that, you can generate a list of it using the bellow python script,
Make sure to change the Gmail username at the bottom of the script as well as the limit (number) of the emails to be generated. Code:
Python:
import os

def generate_usernames(username, limit):
    n = len(username)
    count = 0
    for i in range(1 << n-1):
        if count >= limit:
            break
        yield "".join(username[j] + ('.' if (i & (1 << j)) else '') for j in range(n))
        count += 1

def write_to_file(username, usernames):
    filename = f"{username}_gmails.txt"
    if os.path.exists(filename):
        i = 1
        while os.path.exists(f"{username}_gmails_{i}.txt"):
            i += 1
        filename = f"{username}_gmails_{i}.txt"

    with open(filename, 'w') as f:
        for i, username in enumerate(usernames):
            if i != len(usernames) - 1:
                f.write(username + "@gmail.com\n")
            else:
                f.write(username + "@gmail.com") # Avoid newline for last username

username = "thismailforguideinbhw"
limit = 1000 # Set your limit here
usernames = list(set(generate_usernames(username, limit)))
write_to_file(username, usernames)
You can easily generate 10k++ with this method, these will usually be more than enough.
The email will be saved as the username_gmail.txt under the same folder of the script

The other method would be to use '+' by appending a text after your Gmail username,
For example if your gmail is "[email protected]", you can use variations such as "[email protected]", "[email protected]",
You don't really need to generate any list in here, any combination would work

Where to use this?
Now, the rest is depending on where to use this,
Many platforms do already detect these variations and won't accept these emails,
Others would get your accounts banned after a couple of days,
But hey, this can be useful for several cases, make sure to test before going any further,

I'll be creating a new guide for how to set up your catchall email using your own custom domain next,
This won't require you any kind of coding skills, the easy simple way that won't take you more than a couple of minutes
 
Great guide, thanks for sharing
 
Bookmarked, thanks for sharing
It was a pretty good and very informative tutorial. I have a lot of respect for you taking the time to write this. Thanks
Thanks for sharing. Useful
very helpful guide
Great guide, thanks for sharing
Thanks, This is script is very useful.
Cool, thanks for the tutorial.
Glad it was useful for you ^^


Is it necessary to do all these because the mails already work by default when I add dots. Is there any difference if I skip the setup and just add dots?

As stated here https://support.google.com/mail/answer/7436150
You don't really need anything for that,
You have to enable IMAP, 2FA & use an app password to get it to work with scripts/software
 
  • Like
Reactions: GTC
The method, adding some symbols after "+" is very useful for several A/B testing, e.g. subjectline, informative pic or body text of email
 
Not sure, but are those emails proper for GSA SER projects? Thanks!
This one is better for these tools:
https://www.blackhatworld.com/seo/g...inimal-requirements-gmail-cloudflare.1546809/
The method, adding some symbols after "+" is very useful for several A/B testing, e.g. subjectline, informative pic or body text of email
Thanks mate!
Glad to help out ^^

Just dropped the next guide if anyone needs it:
https://www.blackhatworld.com/seo/g...inimal-requirements-gmail-cloudflare.1546809/
 
Thank you for sharing! Its a great method!!
Do you have a way to use this emails to send bulk emails??

Thanks
 
So, whenever you're tying to creating multiple accounts in some platform,
You'll need to buy/create a shit ton of emails sometimes,
But you could actually use a single Gmail account for that exact purpose without any need for more

Here's what to do:
  • Create or use a Gmail account with at least 15 chars username,
    This can be anything random, it doesn't really matter, take for example "[email protected]",
    This one got 21 chars and it's usually more than enough to generate your emails
Enabling IMAP
Enabling 2FA
  • Now, in order for IMAP to work, we need to enable "2fa", that will require you a phone number or simply download backup codes,
    Go to https://myaccount.google.com/signinoptions/two-step-verification/enroll-welcome
  • Click "Get Started"
  • There will be only option to use a phone number, but while adding a new one, click on "Use another backup option"
    View attachment 298175
  • Make sure to download the codes if you don't have (or added) phone number
  • Next confirm with "I have my backup codes" or confirm your phone number
Generating an App Password
Using Gmail IMAP
Now, in order to use the Gmail IMAP, you'll have to use the following settings:
  • IMAP Host: imap.gmail.com
  • IMAP Port: 993
  • Encryption: ON (SSL)
  • IMAP Username: your Gmail address, in our example it's [email protected]
  • IMAP Password: The App Password that you got earlier

Generate different Gmail Emails
Now for the catchall to work, there are several variations of your email that you can use and they'll be redirected to your main Gmail account,
The first example would be to add dots between the characters, for example if your Gmail is "[email protected]", you can use "[email protected]", "[email protected]", etc...
For that, you can generate a list of it using the bellow python script,
Make sure to change the Gmail username at the bottom of the script as well as the limit (number) of the emails to be generated. Code:
Python:
import os

def generate_usernames(username, limit):
    n = len(username)
    count = 0
    for i in range(1 << n-1):
        if count >= limit:
            break
        yield "".join(username[j] + ('.' if (i & (1 << j)) else '') for j in range(n))
        count += 1

def write_to_file(username, usernames):
    filename = f"{username}_gmails.txt"
    if os.path.exists(filename):
        i = 1
        while os.path.exists(f"{username}_gmails_{i}.txt"):
            i += 1
        filename = f"{username}_gmails_{i}.txt"

    with open(filename, 'w') as f:
        for i, username in enumerate(usernames):
            if i != len(usernames) - 1:
                f.write(username + "@gmail.com\n")
            else:
                f.write(username + "@gmail.com") # Avoid newline for last username

username = "thismailforguideinbhw"
limit = 1000 # Set your limit here
usernames = list(set(generate_usernames(username, limit)))
write_to_file(username, usernames)
You can easily generate 10k++ with this method, these will usually be more than enough.
The email will be saved as the username_gmail.txt under the same folder of the script

The other method would be to use '+' by appending a text after your Gmail username,
For example if your gmail is "[email protected]", you can use variations such as "[email protected]", "[email protected]",
You don't really need to generate any list in here, any combination would work

Where to use this?
Now, the rest is depending on where to use this,
Many platforms do already detect these variations and won't accept these emails,
Others would get your accounts banned after a couple of days,
But hey, this can be useful for several cases, make sure to test before going any further,

I'll be creating a new guide for how to set up your catchall email using your own custom domain next,
This won't require you any kind of coding skills, the easy simple way that won't take you more than a couple of minutes
That was good info mate
 
Thank you for sharing! Its a great method!!
Do you have a way to use this emails to send bulk emails??

Thanks
I believe you're not able to use such emails to send emails, only the original Gmail address,
That's only for receieving

Just wondering what would the usecases of this be?
You can use this to create multiple accounts at the same website,
It should be accepting such variations tho


Bookmarked, thanks for sharing.
Thanks for your sharing. A informative one
That was good info mate
Glad this helps ^^
 
Back
Top