Mobile Phones | Credit Counseling | Bad Credit Loan | Loan | Encyclopaedia
Suvival Guide: Checking your emails QUICKLY without an email program [Archive] - PCMech Forums

PDA

View Full Version : Suvival Guide: Checking your emails QUICKLY without an email program


Statica
01-07-2003, 09:41 AM
As with my post about how to <A HREF="http://forum.pcmech.com/showthread.php?s=&postid=354221#post354221" TARGET="_new">FTP from a command prompt in Windows</A> I just thought that perhaps this might come in handy as well.

This works especially well in situations where say you are visitting someplace and need to run a quick check, and your ISP doesnt have a decent webmail application. Or even if the webmail is too slow... or checking home mails from work and vice versa; this is especially useful if you have this shamelessly large attachment on your mail server and you just want to get rid of it without your email program trying to download it. Or you have this nasty suspicion that there is a virus in one of the mails, and your wonderful Microsoft supplied email program is too dumb to show you any attachments; or the best yet, you want to check the mail headers of the incoming mail beyond which your mail program or your webmail program will allow you to do so comfortably, to track out who is spamming you etc. Or if you are in a different part of the world and your mail server seems to be connected with a 2400 bps modem, this will speed up your mail checking experience.

This is essentially how email programs work, and these commands will let you talk to pretty much most versions of POP3 and IMAP servers.

To start:
1) You essentially need a basic telnet program. In Win9x; there is an obscure telnet program in the win directory; while win2k and XP users can use the Command Prompt and use the telnet program there.
<i>note:</i> by default, in the windows telnet program, esp in Win9x has local echo turned OFF. If you cannot see whatever you type (and you want to), click on OPTIONS and turn on Local Echo. For Win2k/XP users of the CLI, you can type <b>set localecho</b> in the telnet prompt to turn on that option.
2) You need to remember your mail server address (in this case I will use - mailserver.pcmech.com)
3) your user account name (that is stored in your mail program), i'll use <b>statica</b> as an example
4) your userpassword .. for now, i'll use <b>myemail</b>
5) this is a fairly important step, some ISP's and admins especially in a corporate environ. like to change the server ports around a bit. The standard POP port is set at 110, if your server has an alternate port substitute it in place of the 110 and the rest is the same.

These are just a few <b>basic</b> commands to get you started, you can obtain more information by reading the RFC documents for POP servers or checking the documentation of the mail server implementation of your ISP (ok thats a bit far fetched) but these should be more than required for now.
I mean the ability to check your mail by learning about 4 commands is a rather powerful tool.

Also, the server responses will differ based on the configuration of the various ISP's etc, but it essentially is the same format.

As I said, you dont need to carry around a telnet program with you wherever you go, they are on pretty much every OS out there .. even if the OS has a browser installed; with more complex telnet programs you can automate scripts and have a more comfortable UI (the telnet program in Win9x is just awful, but remember this is the survival guide)

syntax used:
commands you type are in <b>bold</b> a line break after whatever you typed automatically means that you hit the enter key
any explanations are in <i>italics</i>
what you should see on your screen (server responses) are in red

Statica
01-07-2003, 09:42 AM
<u>For windows 9x users:</u>
Click on START > RUN > <b>telnet mailserver.pcmech.com 110</b>
You should now see the default telnet program start up
<u>For win2k, xp users or even the *nix</u>
Start a command prompt or command line interface and type:
<b>telnet mailserver.pcmech.com 110</b>
you should now see the command line telnet, its better than most ppl give it credit for, start up.
so let me pick it up with what you should see
<HR>

+OK Hello there
<i>the +OK response is pretty much the standard for most such servers, the rest of what you see is probably customized</i>
<b>user statica</b>
<i>the 'user' command identifies yourself to the server</i>
+OK Password required.
<b>pass myemail</b>
+OK logged in
<i>the pass command supplies your user password, of course it isnt encrypted, but if you are security minded, you wouldnt be using IMAP or POP anyway :) just make sure nobody is looking over your shoulder</i>
<b>list</b>

+OK
1 2181
2 32209
3 1221
4 13455
.

<i>the list command, asks the server to list the mails you have on the server. This isnt the number of new mails there, its the total number of mails, arranged in order of arrival to your account (the newer at the bottom). the mails are assigned sequential numbers. The second set of numbers you see represent the size of the mail in bytes (so you can readily identify what the huge mails are .. those that were sent using outlook express :) or have attachments. mind you, this is the size of the entire transmission, including headers etc etc .. see alternative command to list below .. </i>
<b>retr 3</b>

+OK 1221 octets follow
Return-Path: &lt;yourfriend@pcmech.com&gt;
Delivered-To: pecmech-com-statica@pcmech.com
Received: (qmail 13293 invoked from network); 7 Jan 2003 11:12:47 -0000
Received: from dialpool-210-214-1-17.mail.net.hi (HELO user) (210.1.2.3)
by softdnserror with SMTP; 7 Jan 2003 11:12:47 -0000
Message-ID: <001701c2b63e$baa68ce0$1101d6d2@mail.net.hi>
From: "Tom" <yourfriend@pcmech.com>
To: "Statica" <statica@mailtoyou.com>
References: <003501c2b522$10b7d220$127541db@wave> <002e01c2b57f$25f08930$0200ac0@MORPHEUS> <0a2a01c2b629$a24c02c0$2e7541db@wave> <001e01c2b63a$ab1b80e0$0200ac0@MORPHEUS>
Subject: Where's my car
Date: Tue, 7 Jan 2003 16:49:54 -0530
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000


Dude, where's my car? I have had it up to here of you
taking my car and forgetting where you parked it in your
drunken stupor. If you do not return my car, i will be forced to
call the cops.

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
&lt;HTML&gt;&lt;HEAD&gt;
&lt;META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"&gt;
&lt;META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR&gt;
&lt;STYLE&gt;&lt;/STYLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgColor=3D#ffffff&gt;
&lt;DIV&gt;&lt;FONT face=3DArial size=3D2&gt;
Dude, where's my car? I have had it up to here of you
taking my car and forgetting where you parked it in your
drunken stupor. If you do not return my car, i will be forced to
call the cops.
&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BODY&gt;
&lt;/HTML&gt;



.

<i>the 'retr' command followed by the listed number of the mail, will <u>retrieve</u> the mail for you. Note that the mail comes to you twice, the second time around with HTML, this is partly why email is not supposed to be in HTML.</i>
<b>top 3 5</b>

+OK headers follow
Return-Path: <yourfriend@pcmech.com>
Delivered-To: pecmech-com-statica@pcmech.com
Received: (qmail 13293 invoked from network); 7 Jan 2003 11:12:47 -0000
Received: from dialpool-210-214-1-17.mail.net.hi (HELO user) (210.1.2.3)
by softdnserror with SMTP; 7 Jan 2003 11:12:47 -0000
Message-ID: <001701c2b63e$baa68ce0$1101d6d2@mail.net.hi>
From: "Tom" <yourfriend@pcmech.com>
To: "Statica" <statica@mailtoyou.com>
References: <003501c2b522$10b7d220$127541db@wave> <002e01c2b57f$25f08930$0200ac0@MORPHEUS> <0a2a01c2b629$a24c02c0$2e7541db@wave> <001e01c2b63a$ab1b80e0$0200ac0@MORPHEUS>
Subject: Where's my car
Date: Tue, 7 Jan 2003 16:49:54 -0530
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000


Dude, where's my car? I have had it up to here of you
taking my car and forgetting where you parked it in your
drunken stupor. If you do not return my car, i will be forced to
.

<i>sometimes mails are wayy too long for the size of your telnet window and you cant scroll back, a notorious issue with the WIn9x program, you can get it a bit at a time with the top command; top x y means retrieve the top y lines mail #x</i>
<b>dele 3</b>

+OK deleted.
<i>this marks the mail #3 to be deleted; mails will be deleted only when you quit from the server, so if you typed it wrong, dont fret</i>
<b>rset</b>
+OK Resurrected
<i>This will clear off any mails set to be deleted</i>
<b>quit</b>
+OK Bye-Bye
<i>this will allow you to quit the server gracefully, deleting any mails that you have set to delete, if you made a mistake and deleted a mail you shouldnt have, now is a good time to fret</i>

<HR>
Alternative to using the list command is the 'uidl' command; this is implemented in some servers; and gives you more information of where the mail came from rather than just a simple list. Try it out to see how it works

Summary:
<b>telnet mailserver.address.com 110</b> : logs into mailserver.address.com POP server at port 110
<b>user xyz</b> : identifies the user
<b>pass abc</b> : gives the password for the above user
<b>list</b> : lists the number of mails
<b>retr x</b> : retrieves mail #x from the list
<b>top x y</b> : retrieves the first y lines of mail #x
<b>dele x</b> : marks the mail to be deleted
<b>rset</b> : resets or resurrects mails that are marked to be deleted
<b>quit</b> : logging off

<HR>
I'll see if any of you find it interesting or appealing, and can follow it up with a method of sending mails using the most conveniently available mail server (SMTP), preferably your own .. without the bloat of using an email program.

HTH

Roberto49
01-07-2003, 09:46 AM
Thanks, I would like to hear more.

Roberto

hobey19
01-07-2003, 09:50 AM
how do you do this so when you return the email, you can look at it page by page, rather than the email scroll by you. is there anything similar to the following command (dos)

dir /p

so you hit enter to continue viewing the email, or does the top command work similar to this? does top allow you to continue after viewing the lines your are on? thanx for the help

craig

Statica
01-07-2003, 09:56 AM
no there isnt a way to do it sequentially as you see, I would do it something like
top 3 10 (for the first 10 lines)
top 3 20 (for the first 20 lines .. let the first 10 scroll by you and then read what follows)

doctorgonzo
01-07-2003, 10:06 AM
Thanks for the tip, Statica! Very useful.

David_Jones
01-08-2003, 02:19 AM
Excellent post Statica - very informative.

Thanks!

One question:

My mail server works fine except that is does not seem to recognise the 'set localecho' command (I am using Win2k).

Is there any alternative usage, or any way to get the server to return a list of valid commands?

I tried 'help' and '?', but no joy.

David.

Statica
01-08-2003, 07:07 AM
Hi David_Jones:

Sorry about the confusion .. the set command is local to your telnet program. Try this : open a command prompt - type <b>telnet</b> and press enter. You should now be in the Telnet prompt of Windows 2000. type <b>set localecho</b>
You should see a confirmation with Local Echo is ON. Then press quit. and you will be back to your original Windows 2000 prompt. You can proceed as before to log into your mail server. Mind you .. you do NOT need to set local echo on everytime you use it .. telnet will remember your settings.

scalifash
01-12-2003, 10:11 PM
very cool, I sense this is more for the experimental at heart, if you just want to check your email really quickly you can go to http://www.mail2web.com . Thats what I use when I'm on vacation.

corosus
02-22-2003, 06:33 AM
i found that the little porgram called putty, is a great replacement for the command promt when you need to acess something.
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html