tmpmail – A temporary email right from Linux / Unix terminal

Are you looking to send a temporary email right from your Linux or Unix terminal? Look no further. Try tmpmail command-line utility that allows you to generate a temporary email address for receiving emails. Underneath the script uses 1secmail’s API to receive the emails.

Why use a disposable email from the terminal or web?

Throwaway email often used to send and receive to avoid SPAM. These days we need an email address everywhere. Want to comment on a random blog post or download something? They will ask for a valid email address. Apart from spam often in data breaches, your email address can log in to other services. Hence for privacy and security, you need to use a disposable email ID. After a specific period, your temporary email ID will be deleted and the address will be canceled. You are thus avoiding spam and other privacy/security nightmare. Please note that you do not use a temporary email for sensitive communication. For example, you must not use a temporary email address for contact with your Bank or any other important stuff.

tmpmail – A temporary email right from your terminal

Enough talk. Let us see how to use the tmpmail script.


All you have to do is use the wget command or curl command. Open the Terminal application and then type:
$ wget

--2020-09-14 16:55:08--
Resolving (,,, ...
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11121 (11K) [text/plain]
Saving to: ‘tmpmail’

tmpmail                       100%[=================================================>]  10.86K  --.-KB/s    in 0.002s  

2020-09-14 16:55:08 (5.56 MB/s) - ‘tmpmail’ saved [11121/11121]

Let us review the script:
$ vim tmpmail
Ah, it is a bash script. Make sure you have jq, curl, and w3m installed as dependencies. Run the chmod command to change permissions of a file to executable bit:
$ chmod -v +x tmpmail

Generate a new temporary email address

$ ./tmpmail --generate

Use as a disposable temporary email to anyone.

View the most recent email

$ ./tmpmail --recent
Next we can view the email as raw text, where all the HTML tags are removed:
$ ./tmpmail --text
One can change the browser that is used to render the HTML of the email:
$ ./tmpmail --browser your-browser-name-here
./tmpmail --browser lynx


The chances are high that random apps or websites asking to create an account is very common, and so is a data breach. I hope power Linux and Unix users would find this useful including 1secmail’s API to protect their privacy and security online.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 8 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
8 comments… add one
  • John Smith Sep 14, 2020 @ 17:40

    Re: “Try tmpmail command-line utility that allows you to generate a temporary email address for sending and receiving emails. ”

    This utility is not for sending emails. It is for creating a temporary email address and receiving emails at that address.

    • 🐧 Vivek Gite Sep 15, 2020 @ 11:51

      Thanks for the heads up! I appreciate your post.

  • Mike B Sep 14, 2020 @ 19:31

    That sounds like a quick and easy method for power users. For us infrequent or non-command line users, I suggest just using an extra spare Gmail account specifically set up to use for all your sketchy endeavors. Once a month I delete the 300 or so spam messages I get by just clicking remove all. See Email address below. Please spam or reply to your heart’s content.

  • Edilson Sep 14, 2020 @ 21:34

    linux amazing

  • Luis Sep 15, 2020 @ 17:01

    Suggestion: fox the misspelled word “termianl”.

  • Luis Sep 15, 2020 @ 17:02

    I mean, “fix”… 😂

  • CoderDB Sep 19, 2020 @ 2:52

    I tried. The ‘generate’ argument did not return an email address, though. But when I tried the command without any argument and option, the email address I got is revealed.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum