Over the past couple of days I’ve been thinking about how it would all look to open your mail using just the command prompt. I know it sounds crazy, esp. when you have all these wonderful browsers and mail clients out there. But well, thinking over stuffs like these keeps me going. So, brooding over this for a couple of days gave me a solution.
Below I’ve mentioned in detail the steps I’ve followed to open my Gmail account via Command Prompt.
First off, you will need a tool called Stunnel (found here). This program works as an SSL encryption wrapper between remote clients and local or remote servers. (Most E-Mail services like Gmail uses SSL encryption for the traffic between the server and the client)
Presuming that you have downloaded and installed Stunnel, it is time we get to business.
- Once Stunnel is installed, locate the stunnel.conf file in the installation directory and make the below changes to stunnel.conf file.
- Define the protocols and services you would be using
- sslVersion = all
- options = NO_SSLv2
- client = yes
- options = DONT_INSERT_EMPTY_FRAGMENTS
- Configure the Gmail POP server
- [pop3s]
- accept = 2302
- connect = pop.gmail.com:995
- Make sure you have Telnet services up and running in your machine
- For Windows 7, type in ‘optionalfeatures’ at Run (Win + ‘R’ - Optionalfeatures) and enable both Telnet client and server
- Enabling Telnet services for other version of Windows can be easily looked up from Google
- Once done, fire up Stunnel and reload the stunnel.conf file (Configuration - Reload Stunnel.conf)
- Now Stunnel has configured your system to initiate an SSL connection at port 2302 (configured in stunnel.conf)
- Open Command Prompt (Win + ‘R’ - CMD) and type in the following
- The above entries configures your system to connect to pop.gmail.com:995 (through SSL) and to accept traffic at port 2302 of your machine to be directed to the Gmail POP server
Telnet Localhost 2302
This brings up the following: +OK Gpop ready for requests from 111.222.333.444 abcdefghijklmn.20
(Where 111.222.333.444 is your IP)Key in USER followed by your user name, which is responded by +OK send PASS
Now type your password after the PASS command.
If the server accepts your username and password it responds with the following message +OK Welcome.
Now you are up and running!
Here is a sample of the whole steps, the way it would appear on the screen for an user with the below credentials
Username: test.user
Password: test.password
Telnet Localhost 2303
+OK Gpop ready for requests from 111.222.333.444 abcdefghijklmn.20
USER test.user
+OK send PASS
PASS test.password
+OK Welcome.
STAT
+OK 123 123456
QUIT
+OK Farewell.
You can use the below commands to browse through your mails
- STAT - Retrieves the no# of messages in your mailbox
- RETR X - Displays the Xth message in your inbox
- TOP 1 10 - Retrieves the first 10 lines of message 1
- DELE X - Marks message X for deletion
- QUIT - Closes the session
The RFC 1939 describes in detail the various POP commands and its usage. So if you need a better grasp of the commands given above, I suggest you check out this link.
Please do note the following
- Any invalid command/character closes the session
- Passwords are entered as plain text on the command console and hence this is not a safe way of accessing your mail box. Any person looking at your screen can read the password off your screen. (I am not responsible for any password loss/theft on account of this)
NB: The details above give you a hang of what happens when you access your emails via your browser/client. This is only for educational purposes and is not to be misused. I will not be responsible for any irresponsible/careless use of the above steps.
Well, that’s it for now! Try it out and let me know if you face any difficulties.