Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

write a pop3 program

Posted on 1998-12-07
7
Medium Priority
?
143 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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

926 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