I am working on a IMAP, so just reading the body (body[header.fields (DATE FROM SUBJECT)]) I am passing this command.
But problem is like there some time my string return extra stuff excetp from my original string.
and some times I had getting limited part of the string means half part of the body.
so whenever I am passing second command it will accept as a first command and return result as the
first command pending resul.;
so the my concern is that I am not able to retrive proper data as of the part of the body.
as per my knowladge I think it’s happen due to the internet datapacket tresfersize, but apart from this look at outlook or any other mail manager will work properly so what this is the mechanisam for
this data retriving.
or anything else to do fo my coding…..
Thanks..
Posting a sample response from the IMAP server that contains the “extra stuff” would help.
The problem you are most likely facing is with untagged server responses.
Heres what RFC3501 says:
Status responses can be tagged or untagged. Tagged status responses indicate the completion result (OK, NO, or BAD status) of a client command, and have a tag matching the command:
Some status responses, and all server data, are untagged. An
untagged response is indicated by the token “*” instead of a tag.
So you need to distinguish between those 2 response types.
Please remember that checking if every received line starts from ‘*’ character is not enough, as your email message may also have lines starting from star character:
{342} is the exact number of bytes you are supposed to read.
The bottom line is don’t reinvent the wheel use existing library.
You can check out mine IMAP component (not free).