A temporary e-mail from your terminal: tmpmail

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

In Fedora:

$ 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

It’s done.

Now you can start using tmpmail. Here’s a test for you:

  1. Run ‘tmpmail -g’ to generate a new email address.
  2. Run ‘tmpmail’ to see if your inbox is empty
  3. Send couple of emails to that account
  4. Run ‘tmpmail’ to check your inbox. At this point you’ll see an ID before the sender’s address.
  5. Read a specific email by ‘tmpmail <mail ID>’
  6. Read the most recent mail by ‘tmpmail -r’
  7. Read the most recent mail in a browser by ‘tmpmail -b firefox -r’
  8. Read the most recent mail as text without HTML tags by ‘tmpmail -t -r’

That’s that. See more on my homepage here, tmpmail’s page is here.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *