Opened 7 years ago

Last modified 5 years ago

#3947 defect new

imap4.IMAPServer sends bodystructure body size as string

Reported by: Ilpo Nyyssönen Owned by: argonemyth
Priority: normal Milestone:
Component: mail Keywords: imap fetch bodystructure
Cc: argonemyth Branch:


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 and notice that the examples there do not have quotes around the body size.

Change History (4)

comment:1 Changed 7 years ago by Ilpo Nyyssönen

Same for the lines too.

comment:2 Changed 7 years ago by Jean-Paul Calderone

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. :)

comment:3 Changed 6 years ago by <automation>

Owner: Jean-Paul Calderone deleted

comment:4 Changed 5 years ago by argonemyth

Cc: argonemyth added
Keywords: imap fetch bodystructure added
Owner: set to argonemyth
Note: See TracTickets for help on using tickets.