Problem: mail_fetchtext() incomplete result

David Verhasselt <[email protected]>
Newsgroups gmane.mail.imap.uw.c-client
Message-ID <[email protected]>
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 mail_fetchtext(), some messages return an incomplete
string. I've only witnessed this on attachments, they're truncated to
only a couple of bytes (like 60 bytes). If I use mail_fetchbody() for
the section where the mail was truncated, I do get the complete
string.

It always happens on the same mails, and they are truncated to exactly
the same amount, yet I can't find a common cause. Some mails are
fetched succesfully with attachments of up to 8MB, while some
problematic mails are less than that, so size is not the issue. It's
not a NULL-character issue because the truncation also happens in
base64 encoded strings.

Any ideas what might be causing it and how I could fix it? I'd rather
not use mail_fetchbody() because of the added overhead in glueing the
parts together again afterwards.

Thanks,
David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.