?
Solved

write a pop3 program

Posted on 1998-12-07
7
Medium Priority
?
142 Views
Last Modified: 2010-08-05
I am writing a pop3 program and would like to know what the
good way to parse the mail or multipart mail body. In general practice, is it likely to finish popping a mail and then write the content to a temp file before parse the mailbody or analyse the data immediately once get the data?
which one is easier for coding?

Also, is there any reference about that especially parsing multipart body?

Actually, for some reasons, I should write the program. So, it seems no use if OCXs are suggested. However, it is most appreciated if there are source codes for reference. :)
Thanks

Actually,  
0
Comment
Question by:Torus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 4

Expert Comment

by:anzen
ID: 1448534
Since You're working on a NET I think it's better to write all received data down to a temp file, then, when the message has been completely received split header from body (searching for the first "blank" line) and next parsing the two pieces, for more details about POP3 protocol see the RFC documents, You can easily find them on some sites (e.g. ftp://ftp.garr.it) the RFC which You'd read first are the 821, 822 and 1725

Bye.

0
 
LVL 2

Author Comment

by:Torus
ID: 1448535
Thanks for your answer.
 I understand the RFCs give me the idea of smtp and pop3. However, maybe my question is not clear,  I am concerning how to code the parsing mechanism. It seems quite complicated expecially the content-type is rfc822/message since it may contain another
header within the body.


0
 
LVL 2

Author Comment

by:Torus
ID: 1448536
Thanks for your answer.
 I understand the RFCs give me the idea of smtp and pop3. However, maybe my question is not clear,  I am concerning how to code the parsing mechanism. It seems quite complicated expecially the content-type is rfc822/message since it may contain another
header within the body.


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Accepted Solution

by:
anzen earned 300 total points
ID: 1448537
Well, first as I said You must split Your message into two pieces, that is Header and Body, the next thing to do is load the header into an array (one line at a time), now You should
scan the array with the following rule:

if the current array element begins with a valid char (not space or tab) it is a valid header entry, so save the array index and search the line for the ":" char indicating the end of the header token and the beginning of the header contents

if the current array element begins with a space or tab, it is a continuation line, so get the token from the previously bookmarked line and act as needed

If you have a multi-header message, simply split again the previously obtained body and repeat the parsing.

Alternatively You could get the free Internet Control Pack (ICP) from NetMasters' site at the following address:

http://www.netmastersllc.com/freeax2.html

Let me know...

0
 
LVL 2

Author Comment

by:Torus
ID: 1448538
I have finished the parsing mechanism. Anyway, thanks for your answer.

0
 
LVL 2

Author Comment

by:Torus
ID: 1448539
BTW, What's the control for?
0
 
LVL 4

Expert Comment

by:anzen
ID: 1448540
It's a control pack featuring POP3, SMTP, NNTP, HTTP, FTP and other OCX, it was formerly distributed by MS, now it's freely downloadable from the URL I mentioned above
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question