3

GitHub - sdushantha/tmpmail: A temporary email right from your terminal written...

 2 years ago
source link: https://github.com/sdushantha/tmpmail
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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 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/

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

$ yay -S tmpmail-git

Nixpkgs

tmpmail is also available in the nix package collection (only unstable currently), which is maintained by legendofmiracles

Either add it to your system packages, install it with nix-env or try it out in a ephemeral nix-shell nix-shell -p tmpmail

Usage

$ tmpmail --help
tmpmail
tmpmail -h | --version
tmpmail -g [ADDRESS]
tmpmail [-t | -b BROWSER] -r | ID

When called with no option and no argument, tmpmail lists the messages in
the inbox and their numeric IDs.  When called with one argument, tmpmail
shows the email message with specified ID.

-b, --browser BROWSER
        Specify BROWSER (default: w3m) that is used to render the HTML of
        the email
-g, --generate [ADDRESS]
        Generate a new email address, either the specified ADDRESS, or
        randomly create one
-h, --help
        Show help
-r, --recent
        View the most recent email message
-t, --text
        View the email as raw text, where all the HTML tags are removed.
        Without this option, HTML is used.
--version
        Show version

Examples

Create random email

$ tmpmail --generate
[email protected]

Create custom email

View the inbox

$ tmpmail
[ Inbox for [email protected] ]

83414443   [email protected]   Test Email

View the email

$ tmpmail 83414443

View the most recent email

$ tmpmail -r

View emails as pure text

$ tmpmail -t 83414443
To: [email protected]
From: [email protected]
Subject: Test Email

Hello World

[Attachments]
https://is.gd/aBCdEf [apple.jpg]
https://is.gd/AbCDeF [ball.jpg]

Credits

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK