/tmpmail

📬 A temporary email right from your terminal written in POSIX sh

Primary LanguageShellMIT LicenseMIT

A temporary email right from your terminal written in POSIX sh


tmpmail is a command line utility written in POSIX sh that allows you to create a temporary email address and receive emails to the temporary email address. It uses 1secmail's API to receive emails.

By default, emails will be generated by random unless the --generate argument is followed by the desired email address.

By default w3m is used to render the HTML emails on the terminal. But if you prefer another text based web browser or would rather view the email in a GUI web browser such as Firefox, simply use the --browser argument followed by the command needed to launch the web browser of your choice.




Dependencies

  • w3m
  • curl
  • jq

Installation

Install locally

# Download the tmpmail file and make it executable
$ curl -L "https://git.io/tmpmail" > tmpmail && chmod +x tmpmail

# Then move it somewhere in your $PATH. Here is an example:
$ mv tmpmail ~/bin/

AUR

tmpmail is available on the AUR, which is currently being maintained by Benjamin Bädorf

$ yay -S tmpmail-git

Usage

$ tmpmail --help
usage: tmpmail [-h] [--generate] [--text] [--browser BROWSER] [--recent] ID

optional arguments:
-h, --help           Show this help message
    --version        Print version
-g, --generate       Generate a new email address. You may aslo pass a custom email address along with this flag
-r, --recent         View the most recent email
-t, --text           View the email as raw text, where all the HTML tags are removed
-b, --browser        Change the browser that is used to render the HTML of the email (default: w3m)

Examples

Create random email

$ tmpmail --generate
xoithrjagpx@1secmail.net

Create custom email

$ tmpmail --generate mycustomemail@1secmail.com
mycustomemail@1secmail.com

View the inbox

$ tmpmail
[ Inbox for wdebivbyjor@1secmail.com ]

83414443   username@example.com   Test Email

View the email

$ tmpmail 83414443

View the most recent email

$ tmpmail -r

View emails as pure text

$ tmpmail -t 83414443
To: wdebivbyjor@1secmail.com
From: username@example.com
Subject: Test Email

Hello World

Credits

This script is heavily inspired by Mitch Weaver's 1secmail script