Ticket #3947 defect new

Opened 5 years ago

Last modified 21 months ago

imap4.IMAPServer sends bodystructure body size as string

Reported by: biny Owned by: argonemyth
Priority: normal Milestone:
Component: mail Keywords: imap fetch bodystructure
Cc: fei@… Branch:
Author: Launchpad Bug:


Made test_imap.SimpleClient to log the received lines and ran test


The bodystructure line received is

'* 0 FETCH (BODYSTRUCTURE ("text" "plain" (("name" "thing") ("key" "value")) "this-is-the-content-id" "describing-the-content-goes-here!" "8BIT" "20" "4" NIL NIL NIL))'

See how the body size is quoted. Now look at  http://tools.ietf.org/html/rfc3501#section-7.4.2 and notice that the examples there do not have quotes around the body size.

Change History


Changed 5 years ago by biny

Same for the lines too.


Changed 5 years ago by exarkun

I'm not sure this behavior is actually against the spec. Quoted strings fill almost exactly the same role in the grammar as unquoted strings. However, not quoting things when it is not necessary to (as it should never be necessary in these cases), particularly if doing so causes the results to line up with an example from the RFC, still sounds like a good thing.

I'm a bit surprised at this behavior. collapseNestedLists already has some code to avoid quoting numbers. Perhaps collapseNestedLists isn't actually being used for this case (somehow... that would be extra weird). Or maybe getBodyStructure isn't giving back numbers for these fields. Ah, yes, that seems to be it. It explicitly converts the size and line count to strings. Possibly it should leave them as numbers, or possibly it should use the DontQuoteMe helper. Whichever has the least impact. :)


Changed 3 years ago by <automation>

  • owner exarkun deleted


Changed 21 months ago by argonemyth

  • cc fei@… added
  • owner set to argonemyth
  • keywords imap fetch bodystructure added
Note: See TracTickets for help on using tickets.