How to Generate Temporary Email Addresses Using the Linux Terminal

Delta Online News

Email inboxes are like your digital postbox for receiving important messages. A lot of websites require you to sign up with your email before you can fully access their services or products.

However, giving away your personal or work email address to shady websites can lead to a cluttered inbox full of unwanted newsletters, spam, and possible data breaches. To avoid this, you might be inclined to use a temporary email service.

Find out how you can do just that right from the Linux terminal.

Install the tmpmail Command-Line Tool

Tmpmail is a command-line tool that uses 1secMAIL API to create a throwaway email address and receive emails on it. The email address generated from this service is automatically self-destructed after some time to maintain your anonymity.

Learn More: How APIs Work and How to Integrate Them Into Your App

To install this tool on your Linux machine, open the terminal emulator of your choice and run the following command:

curl -L "" > tmpmail && chmod +x tmpmail

The command given above works across all Linux distributions. However, if you're using Arch Linux or its derivatives, you can alternatively choose to install the package via the Arch User Repository. Here's how you can do that using yay:

yay -S tmpmail-git

To confirm that your installation succeeded, run the following command and check if the script is working:

./tmpmail --help


Generating Email Addresses and Receiving Emails

To generate a random email address using your terminal, run this command:

./tmpmail --generate

The output will provide you a temporary email address that you can use.

For a custom email address with the 1secMAIL domain, you can run this command instead:

./tmpmail --generate


You can view all the emails received on the temporary email address that you last generated with this command:


This will display all the emails along with their ID, sender, and subject. To view a particular email address, you can use the command given below:

./tmpmail <mail-id>


If you wish to view the most recent email that you received, use the -r flag in this manner:

./tmpmail -r

Combat Spam With Temporary Email Addresses

The next time you have to reveal your email address to some website you're skeptical about, you can make use of this command-line tool instead. You don't have to bother about blocking spam emails anymore.

In case you prefer a web user interface over the command-line interface, here are some alternatives that you can try.

MUO – Feed