Strange Bad FETCH requests

10 views
Skip to first unread message

Night Lynx

unread,
Sep 18, 2023, 4:18:36 AM9/18/23
to VMime
Hello!
I want to use vmime for collecting emails from IMAP folders. Some of these folders are large (>10000 messages). Whenever the folder has more than 999 messages I get a "bad fetch" error, because the FETCH command is sent to the server with an additional space after the first digit. For example, fetching message number 1345 creates the following FETCH command:

c003 FETCH 1 345 BODY[]

I can't trace the error. I know that fetching about 9000 messages worked with the early code, but now I always get the extra space once I hit the 1000. Development system is a Debian 12 with vmime from the package repository. IMAP server is a Dovecot 2.3.x.

Best regards,
René.

Vincent Richard

unread,
Sep 18, 2023, 10:54:41 AM9/18/23
to VMime
Hello René!

What is the default locale on your platform?
Could you please run your test executable with "LANG=C" environment variable (eg. "LANG=C ./my-test-program") and see if the problem still occurs?

The issue you have should not occur, because the classic locale ("C") is always forced when formatting commands with std::ostringstream.

Vincent

Night Lynx

unread,
Sep 18, 2023, 1:09:07 PM9/18/23
to VMime
Hello, Vincent!

My locale is "nb_NO.UTF-8". Switching to LANG="C" solves the problem. The message numbers >999 now don't have an additional space. Thanks!

Best regards,
René.
Reply all
Reply to author
Forward
0 new messages