login about faq

Hi, I use this method to get the email header and the first 100 lines of body. Is there a way to know if the first 100 lines are all lines contained in the body?

Thank you

asked Sep 11 '12 at 04:47

adams79's gravatar image


A header is downloaded via the "TOP" command in the POP3 protocol (see RFC 1939 http://www.ietf.org/rfc/rfc1939.txt )

The TOP command downloads the MIME headers and the 1st N lines of the MIME body. MIME however, is a recursive (tree structured) format, where the MIME body may itself be 1 or more MIME messages, each with a header and body (where each body may in turn be 1 or more MIME messages, each with header and body, and so on..)

(An email with attachments, plain-text and HTML alternative bodies, etc. are "multipart" MIME messages, meaning that the Content-Type of the topmost header is something like "multipart/mixed" or "multipart/alternative", and the body is itself is composed of one or more MIME messages.)

The answer is that the TOP command pays no attention to the MIME structure. It simply returns the 1st N lines following the initial MIME header. It's impossible to know ahead of time whether you're asking for enough lines to get the entire human-readable "main text" of the email.


answered Sep 11 '12 at 09:47

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Sep 11 '12 at 04:47

Seen: 1,434 times

Last updated: Sep 11 '12 at 09:47

powered by OSQA