[Imap-uw] Problem: mail_fetchtext() incomplete result

2009-07-19 Thread David Verhasselt
Hi all, I'm creating an IMAP backup app which basicaly fetches all mails and dumps them to a Maildir. I'm using UW's c-client as the IMAP interface API. I've been wrestling with a weird bug for some time now, and since I can't find a solution I'm turning to this list. When calling

Re: [Imap-uw] Problem: mail_fetchtext() incomplete result

2009-07-19 Thread Mark Crispin
Turn on debugging telemetry and you will see the IMAP protocol interactions via mm_dlog(). Is the data being truncated from the server? Note that mm_dlog() will not show the data in literals, but you will see the byte counts and that should indicate if you are getting truncated data. If the

Re: [Imap-uw] Problem: mail_fetchtext() incomplete result

2009-07-19 Thread David Verhasselt
Thanks Mark. I wasn't aware of the single buffer for all mail_fetch***() functions, but I'm converting the results to std::strings directly afterwards so it doesn't affect the app. Turning on debugging telemetry showed that the message is transmitted truncated by the server. This is the Gmail

Re: [Imap-uw] Problem: mail_fetchtext() incomplete result

2009-07-19 Thread David Verhasselt
Found an even easier solution: Reading the IMAP specification I noticed one can use mail_fetchbody() with an empty section specifier () to retrieve the whole mail, including headers. Downloading the message this way makes the Gmail IMAP server transmit the whole message, untruncated. Now I can