This brief guide explains what is temporary email, what is tmpmail and how to create temporary emails from command line with Tmpmail in Linux and Unix-like operating systems.
What is temporary email or disposable email?
Nowadays, a valid E-mail id is required by almost all web sites, blogs, forums and services. Some web sites will not allow you to use them without a registered account. You can't even write a comment in those sites without an account. When creating an account with your Email, they will send a conformation E-mail and you have to verify it in-order to start using such web sites.
Many of you don't want to use your personal or professional E-mail id to sign-up in random sites and blogs. This is where the disposable email or temporary email comes in rescue. A temporary mail id can be used to subscribe or create an account in situations where it is mandatory to confirm your Email. The temporary email ids can help you to keep spam out of your inbox, protect your privacy and stay safe online.
There are plenty of temporary email providers that allows you to quickly create a free disposable Email id, so you can use it wherever necessary. The temporary emails will be deleted by the providers after a certain period of time.
What is tmpmail?
Tmpmail is a command line utility that allows you to create temporary emails and receive the mails to these temporary email address in GNU/Linux and other Unix-like operating systems. It uses 1secmail's API to receive mails.
By default, Tmpmail uses
w3m text browser to access your temporary mail box to read the mails. You can, of course, use any other text-based or graphical web browsers with
--browser argument, followed by the command to launch the web browser. Tmpmail is just a Bash shell script and is released under MIT license.
Install tmpmail on Linux
Tmpmail requires the following prerequisites to work:
They are available in the official repositories of most Linux distributions. For instance, you can install
git in Arch Linux and Manjaro Linux using command:
$ sudo pacman curl git jq w3m
On Debian, Ubuntu and its derivatives:
$ sudo apt install curl git jq w3m
Fedora, RHEL, CentOS:
$ sudo dnf install curl git jq w3m
$ sudo dnf install curl git jq w3m
After installing the prerequisites, git clone the tmpmail repository:
$ git clone https://github.com/sdushantha/tmpmail.git
This will clone the contents of tmpmail repository in a local directory named
Copy the tmpmail script to your $PATH, for example
$ sudo cp tmpmail/tmpmail /usr/local/bin/
Create Temporary Emails From Command Line With Tmpmail
To create a temporary Email id using tmpmail, run:
$ tmpmail -g
$ tmpmail --generate
A temporary email id will be created with 1secmail.net domain name. In my case, I got the following id.
You can use this email id to register an account or download contents or comment in a site/forum/discussion board.
To check if the mail id works, just send a test mail to this temporary email address from one of your personal/professional mail id.
I am going to send a mail from my Gmail id.
Done! We just sent a test mail to a 1secmail email id.
Now go back to the Terminal and check if the mail has arrived as shown in the following step.
View mailbox with tmpmail
To access your 1secmail mail box, run the following command from your Terminal:
[ Inbox for [email protected] ] 84248310 [email protected] Reg: Test mail
- [email protected] - receiver's email id.
- 84248310 - the message id.
- [email protected] - sender's mail id.
To read the message, run tmpmail with the email message id like below:
$ tmpmail 84248310
To: [email protected] From: [email protected] Subject: Reg: Test mail Hi, This is just a test mail. -- Regards, The OSTechNix Team, www.ostechnix.com <=UpDn Viewing <tmpmail.html>
There it is! I can be able to access the mails from command line in
w3m browser. To exit, press
q followed by
Here is the short video demonstration for tmpmail.
View most recent mails
If there are many mails in the mail box, you can directly open the most recent email message using
$ tmpmail -r
View mails in different browsers
As stated already, tmpmail uses
w3m text browser to read the mails in your mail box. You can also view the email content in other web browsers with
-b or --browser option.
For instance, let us open the mail in Mozilla Firefox using the following command:
$ tmpmail -b /usr/bin/firefox 84248310
$ tmpmail --browser /usr/bin/firefox 84248310
Here, the mail is displayed in the graphical Firefox browser window.
View mails in plain text
Tmpmail displays the Email in HTML format by default. You also view plain text instead of the HTML format.
To do so, use
--text flags to read the messages:
$ tmpmail -t 84248310
$ tmpmail --text 84248310
To display tmpmail help section, run:
$ tmpmail -h
$ tmpmail --help
To print the version, run:
$ tmpmail --version
Temporary emails are very convenient to enjoy the most benefits of an Internet site without giving away your personal information. With tmpmail, it got even easier to create temporary email addresses and receive mails for command line nerds. Give it a try and let us know what you think about this project in the comment section below.
- How To Google Search From Commandline Using Googler
- How To Search DuckDuckGo From Commandline Using ddgr
- Surfraw – A Commandline Interface To Popular Search Engines And 100+ Websites
- How To Search The Web From Terminal On Linux
- Google Search Navigator – Enhance Keyboard Navigation In Google Search
- How To Use Google Translate From Commandline In Linux
- GooBook – Access Your Google Contacts From Commandline In Linux
- DuckDuckGo Bangs – Search Directly On Your Favorite Websites
Featured photo by Miguel Á. Padriñán from Pexels.