Solved

write a pop3 program

Posted on 1998-12-07
7
141 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 4

Accepted Solution

by:
anzen earned 100 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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
Course of the Month5 days, 13 hours left to enroll

627 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