Setup and Configure tmpmail - Step by Step Process








Are you trying to Setup and Configure tmpmail? 

Let this guide put you through.


If we choose to stay within the command line for almost every role or purpose, tmpmail is a handy utility. It is a quick and easy method to create a temporary email address to use for incoming mail.

Tmpmail is basically a utility written in bash that allows a user to create and use a temporary email address for receiving emails from the command-line.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Linux Command-line queries.

In this context, we shall look into tmpmail along with its setup and configuration.


How to Setup and Configure tmpmail ?

To begin with this setup, you need to have the following:

i. w3m – A text-based web browser.

ii. wget or curl command.

iii. jq – A flexible, lightweight JSON processor for the command line.


To install w3m, wget, curl and jq in Arch Linux and Manjaro Linux, we run:

$ sudo pacman curl jq w3m wget

On Debian, Ubuntu and its derivatives:

$ sudo apt install curl wget jq w3m

Fedora, RHEL, CentOS:

$ sudo dnf install curl wget jq w3m

OpenSUSE:

$ sudo dnf install curl wget jq w3m


How to install tmpmail ?

i. Start by using wget command or curl command to download the script from GitHub.

ii. Then we open a terminal and copy or type in the following command:

# wget https://raw.githubusercontent.com/sdushantha/tmpmail/master/tmpmail
–2021-04-12 12:31:32–
https://raw.githubusercontent.com/sdushantha/tmpmail/master/tmpmail
Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 151.101.248.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.248.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 12433 (12K) [text/plain]
Saving to: ‘tmpmail.’
tmpmail 100%[=========================================>] 12.14K –.-KB/s in 0s
2021-04-12 12:31:32 (97.9 MB/s) – ‘tmpmail’ saved [12433/12433]
[root@server ~]#

iii. Now, to make the file executable we run the chmod command against the script to modify the permissions:

# chmod -v +x tmpmail

iv. Then, we will move the file to a location somewhere in our $PATH:

# mv tmpmail /bin/
# which tmpmail
/usr/bin/tmpmail
#


Help File relating to tmpmail

The info from Help File provides a shortlist of how to use tmpmail.

To view the contents of the help file, we use the bl commands:

# 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 inbox messages and their numeric IDs. 

When called with one argument, tmpmail shows the email message with the specified ID.


-b, –browser BROWSER

Specify BROWSER (default: w3m) that is used to render the HTML of the email.


-g, –generate [ADDRESS]

To 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

[root@server ~]#


How to use tmpmail ?

1. Generate a New tmpmail Address

We can create a new temporary email address via:

# tmpmail –generate
8ikknrkybqw@wwjmp.com
#

We can now use the 8ikknrkybqw33ds@wwjmp.com temporary email address to send and receive messages.


2. Receive Email

To test this installation and its functionality, we send an email to the address above from a Gmail account.

After a few minutes of running the tmpmail command, we will receive this output:

# tmpmail
[ Inbox for 8ikknrkybqw33ds@wwjmp.com ]
105575154 ibmimedia@ibmimedia.com Tmpmail Test
#

In short, the email went through and was received by tmpmail. We can now view the email as raw text, where all the HTML tags are removed using:

# tmpmail 105575154

Once we read the email, we hit 'q,' and then, when prompted, 'Do you want to exit w3m? (y/n), hit 'y'.

Eventually, the browser will close and return us to the command prompt.


3. View Recent Email

If there are multiple emails, we can review the most recent one using:

# tmpmail -r

If this gives numerous emails, we can rerun the tmpmail command to see a list of the current emails:

# tmpmail
[ Inbox for 8ikknrkybqw33ds@wwjmp.com ]
105576629 ibmimedia@ibmimedia.com Re: Tmpmail Test
105575154 ibmimedia@ibmimedia.com Tmpmail Test
#

4. Change Browser Type

We can change the browser type to render the HTML of the email by running either of the two below:

# tmpmail –browser lynx 105576629
# tmpmail -b lynx 105576629

Additionally, if we have a browser like Firefox, we can use Firefox's path to open the email.

# tmpmail -b /usr/bin/firefox 105576629

5. View Email in Plaintext

In addition, we can view the email in plaintext. For that, use the -t or –text flags to read the message:

# tmpmail -t 105576629 [root@server ~]# tmpmail –text 105576629 To: 8ikknrkybqw33ds@wwjmp.com From: ibmimedia@ibmimedia.com Subject: Re: Tmpmail Test This is a 2nd test email.
Regards,
=====================
Ibmi Media
IbmiMedia Marketing Team
On Mon, Apr 12, 2021 at 4:42 PM Bob John <ibmimedia@ibmimedia.com> wrote:
Test1
Regards,
=====================
Ibmi Media
IbmiMedia Marketing Team [root@server ~]#


6. Attachments

On the other hand, let us see if the temp email can receive an attachment.

In this test, we create a new email from the Gmail account and attach a text file to see if it will provide a link to the file:

[root@server ~]# tmpmail
[ Inbox for 8ikknrkybqw33ds@wwjmp.com ]
105578915 ibmimedia@ibmimedia.com Attachment Test Email
105576629 ibmimedia@ibmimedia.com Re: Tmpmail Test
105575154 ibmimedia@ibmimedia.com Tmpmail Test
[root@server ~]#

From the output, we know we received the email.


Then we will look for the attachment:

[root@server ~]# tmpmail 105578915

Since there is no attachment in the w3m view, we check in plaintext view.

[root@server ~]# tmpmail -t 105578915
To: 8ikknrkybqw33ds@wwjmp.com 
From: ibmimedia@ibmimedia.com
Subject: Attachment Test Email

In this email, we created a text file, attached it and sent it to the tmpmail email address we created.

Here ya go!
Regards,
=====================
Ibmi Media
IbmiMedia Marketing Team
[root@server ~]#

The attachment was not seen here either.

In reviewing the API from 1secmail.com, the API can receive attachments. However, this script is not equipped to use that functionality.


Where Does the Domain Originate From?

Like other temporary email services (e.g., temp-mail.org, 10minutemail.com), the domain name is pulled from domains owned by 1secmail.

The email address generates via an API call from 1secmail.com and links to one of the following domains:

1secmail.com
1secmail.net
1secmail.org
esiix.com
wwjmp.com

Using this method, we can generate an almost infinite number of email addresses across those five domains.


[Need help with tmpmail configuration? We can help you. ]



Conclusion

This article covers method to Setup and Configure tmpmail.

Basically, tmpmail is a handy utility for CLI warriors within the command line. 

By default, email addresses are created at random unless a specific email address follows the --generate flag.

Currently, w3m renders the emails in an HTML format within the terminal. If preferred, a user can use a GUI or text-based browser to view the email by passing the --browser flag followed by the command needed to launch the web browser of your choice.

TEMP-MAIL does not store your IP-address. This means you are reliably protected from all unauthorized actions that may endanger your information and compromise your privacy. All emails and data temporarily stored on our service are permanently deleted after the time expired.


How to install tmpmail ?

1. To install tmpmail, we can use the wget command or curl command to download the script from GitHub. 

Next, open a terminal and then copy or type in the following command:

# wget https://raw.githubusercontent.com/sdushantha/tmpmail/master/tmpmail

2. Now, run the chmod command against the script to modify the permissions, so the file is executable.

[root@host2 ~]# chmod -v +x tmpmail

3. Next, we will move the file to a location somewhere in our $PATH. Use the following command to accomplish this.

# mv tmpmail /bin/
# which tmpmail
/usr/bin/tmpmail


To Generate a New tmpmail Address:

To create a new temporary email address, run the following command.

# tmpmail --generate

For Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on LinuxAPT.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com