login about faq

Here's one that I'm seeing with Yahoo! IMAP, hopefully someone can shed some light on..

I am pulling down messages headers using FetchSequenceHeaders(...), after which I get each email header using:

CkEmail *email=0;
email = bundle->GetEmail(x);

... After doing that I take a look at the message size using the following:


Reported size for one example is 24311 bytes.

Later when I attempt to pull down the message (same message mind you, no changes)


I end up with 12888 bytes of data.

Any idea why I get two different values? The same logic works fine with gMail..


Edit - More details. The get_Size appears to be reporting something other than the actual "size" of the message are returned by fetchSingleAsMime. However, sadly if I use "Content-Length" as the header value to check for size on Yahoo! I get a message length that results in a truncated message.

asked Dec 14 '12 at 14:22

hazmat's gravatar image


When a header-only is downloaded from an IMAP server, the size information comes from the IMAP server's response. For example:

((("text" "plain" ("charset" "utf-8") NIL NIL "quoted-printable" 13444 545 NIL NIL NIL)
("text" "html" ("charset" "utf-8") NIL NIL "quoted-printable" 42262 702 NIL NIL NIL) 
"alternative" ("boundary" "----=_NextPart_001_0142_01CDCE75.80E4B4A0") NIL NIL)
("image" "gif" ("name" "image001.gif") "image001.gif@01CDCE72.EA330C20" NIL 
"base64" 1960 NIL NIL NIL) "related" 
("boundary" "----=_NextPart_000_0141_01CDCE75.80E4B4A0") NIL "de") BODY[HEADER] {1571}
You can see the total size of the email is reported to be 59980 bytes. Chilkat will take this information and save it to a "ckx-imap-totalSize" header field, such as:
ckx-imap-totalSize: 59980
If this header field is present, then it is returned by email->get_Size(). Otherwise, the size of the email is computed by traversing the MIME structure and summing up the individual sizes of header+body of each MIME part.

Finally, if a header-only is downloaded using the POP3 protocol (not IMAP), then the size of the email is obtained via a separate POP3 command (either occurring at the time of download, or cached from a previous command that obtained the list of UIDL's and/or sizes). In this case, the "CKZ-HeaderOnly" email header field is added along with a "CKZ-Size" header to indicate the total size of the email. If these two fields are present, then the size reported is that of the "CKZ-Size" header field.


answered Dec 17 '12 at 09:00

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: Dec 14 '12 at 14:22

Seen: 1,294 times

Last updated: Dec 17 '12 at 09:00

powered by OSQA