andris9 / hoodiecrow

Scriptable IMAP server for client integration testing
http://andris9.github.io/hoodiecrow/
Other
60 stars 25 forks source link

bodystructure not according to RFC 3501 #6

Closed felixhammerl closed 10 years ago

felixhammerl commented 10 years ago

hi,

i run an integration test againt 1.1.19, when i noticed that the bodystructure is not according to RFC 3501 Section 7.4.2.

I couldn't locate where this is happening in the code, but there seems to be an extra field, so when inbox parses the fetch response, the disposition is at index 9 instead of index 8 of the body structure...

cheers felix

andris9 commented 10 years ago

Hey, the bodystructure changes according to the contents, so this could be a bug or a feature depending on the input. Could you provide a sample of the data that is parsed into the invalid bodystructure object?

For example, if the message has content type text/*, then there is an additional value for the line count at index 7 (zero based) and this shifts remaining indexes by 1.

felixhammerl commented 10 years ago

sorry, error on my part! i overlooked something in the RFC:

A body type of type MESSAGE and subtype RFC822 contains,
immediately after the basic fields, the envelope structure,
body structure, and size in text lines of the encapsulated
message.

A body type of type TEXT contains, immediately after the basic
fields, the size of the body in text lines.  Note that this
size is the size in its content transfer encoding and not the
resulting size after any decoding.

hoodiecrow is working nicely, as always :)

i will fix the error in the inbox bodystructure parser and submit a pull request to adress this issue asap!