tmpmail is a command-line program that can create temporary email addresses for you to hand over places in order to avoid spams and protect your identity. The tool uses 1secmail’s API, with the help of curl, jq, and w3m.Once it is installed, the tool has options to generate a new temporary mail address for you (option -g), view the most recent email got by the temporary mail address (option -r), view the emails in text mode (without HTML tags) (option -t), and view the email in a browser (option -b).Those are what it can do. What about things that it cannot do? It cannot:
- Send emails, since it is not supported by 1secmail’s API.
- Download attachments even if it is supported by API.
How to install?
You need to install 4 things first:
- w3m: A text-based web browser
- curl: A program to transfer data with different protocols, including http.
- jq: A command tool for parsing JSON.
- git: A source control program(required for downloading tmpmail)
In any Debian or Ubuntu based distro:
$ sudo apt install w3m curl jq git
$ sudo dnf install w3m curl jq git
In Arch Linux / Manjaro:
$ sudo pacman -S w3m curl jq git
After getting dependencies, get source for tmpmail and install it:
$ git clone https://github.com/sdushantha/tmpmail $ cd tmpmail $ sudo install tmpmail /usr/local/bin
Now you can start using tmpmail. Here’s a test for you:
- Run ‘tmpmail -g’ to generate a new email address.
- Run ‘tmpmail’ to see if your inbox is empty
- Send couple of emails to that account
- Run ‘tmpmail’ to check your inbox. At this point you’ll see an ID before the sender’s address.
- Read a specific email by ‘tmpmail <mail ID>’
- Read the most recent mail by ‘tmpmail -r’
- Read the most recent mail in a browser by ‘tmpmail -b firefox -r’
- Read the most recent mail as text without HTML tags by ‘tmpmail -t -r’