Subject: | BodyStructure parsing failure |
Using UW IMAP 2002d I can get a bodystructure from a message that looks like this:
3 fetch 1 bodystructure
* 1 FETCH (BODYSTRUCTURE ("AUDIO" "X-WAV" ("NAME" "test.wav") NIL NIL "BASE64" 144386 NIL ("INLINE" ("FILENAME" "test.wav")) NIL NIL))
Putting that through Mail::IMAPClient 2.2.9 with Parse::RecDescent 1.80 it fails. The following code:
use Mail::IMAPClient::BodyStructure;
print "test 1 failed\n" unless Mail::IMAPClient::BodyStructure->new('* 7 FETCH (UID 51 BODYSTRUCTURE ("AUDIO" "X-WAV" ("NAME" "test.wav") NIL NIL "BASE64" 53738 NIL ("INLINE" ("FILENAME" "test.wav")) NIL NIL))');
print "test 2 failed\n" unless Mail::IMAPClient::BodyStructure->new('* 7 FETCH (UID 51 BODYSTRUCTURE ("AUDIO" "X-WAV" ("NAME" "test.wav") NIL NIL "BASE64" 53738 NIL ("INLINE" ("FILENAME" "test.wav")) NIL))');
prints "test 1 failed". Note that the removal of the last "NIL" causes the parse to succeed.
Running the above code with $::RD_TRACE = 1 shows the string "NIL))" remaining at the end.
Unfortunately I don't know enough about IMAP to determine whether this is a UW IMAP bug or a Mail::IMAPClient bug. If it's the former, it would still be nice if Mail::IMAPClient could work with it.
Some other possibly useful info:
perl -v: This is perl, v5.8.1 built for i386-linux-thread-multi
uname -a: Linux localhost 2.4.22-1.2115.nptl #1 Wed Oct 29 15:42:51 EST 2003 i686 i686 i386 GNU/Linux
Thanks,
Geoffrey D. Bennett