A temporary email right from your terminal 。
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
xclip
Installation
Install locally
# Download the tmpmail file and make it executable
$ curl -L "https://raw.githubusercontent.com/sdushantha/tmpmail/master/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
Pacstall (Debian/Ubuntu)
tmpmail
is available on the pacstall-programs repository, which is being currently being maintained by wizard-28
$ pacstall -I tmpmail-bin
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 that is used to render the HTML of
the email (default: w3m)
--clipboard-cmd COMMAND
Specify the COMMAND to use for copying the email address to your
clipboard (default: xclip -selection c)
-c, --copy
Copy the email address to your clipboard
-d, --domains
Show list of available domains
-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
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
[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。
from
https://github.com/sdushantha/tmpmail
--------------------------------------------------------------------------
Tmpmail是一款可用于快速生成临时电子邮箱的开源命令行工具,遵守MIT开源协议。可以在Linux/Unix操作系统中创建临时电子邮件,并可以接收到这些临时电子邮件地址。
Tmpmail基于 1secmail的 接收邮件的API。 使用 –browser 参数启动Web浏览器,默认使用 w3m 文本浏览器访问临时邮箱以阅读邮件。
使用方法:
创建一个临时的电子邮件ID,请运行:
$ tmpmail -g
或
$ tmpmail --generate
临时电子邮件ID将创建为 1secmail.net 域名。可以使用此Email电子邮件ID在网站/论坛/讨论板上注册帐户或下载内容或评论。
可使用 -r 直接打开最新的电子邮件。
$ tmpmail -r