tags:

views:

30

answers:

1

I'm working with IMAP and attempting to find a way to find the size of an IMAP message prior to actually uploading it to a server from a client (not a server-to-server transfer).

Once the message is actually on the server, finding its size is relatively easy - you can just use a BODY structure then use mail_fetchstructure, as in:

BODY *bodyStructure;
mail_fetchstructure(MailStream, msgno, &bodyStructure);
printf("Message size: %u\n", bodyStructure->size.bytes);

However, that will only work after you upload the message to the server. I'm trying to find the size of the IMAP message, as it will be, once it has been uploaded to the server. Does anyone have any ideas?

A: 

Which C++ framework are you using? In python you upload the message as a string, so you could just take the length of the string...

vy32