Class: Net::IMAP::BodyTypeAttachment
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Struct
|
|
Instance Chain:
self,
BodyStructure ,
Struct
|
|
Inherits: |
Struct
|
Defined in: | lib/net/imap/response_data.rb |
Overview
WARNING
BodyTypeAttachment
represents a body-fld-dsp
that is incorrectly in a position where the IMAP4rev1 grammar expects a nested body
structure.
IMAP body structures are parenthesized lists and assign their fields positionally, so missing fields change the intepretation of all following fields. Buggy IMAP servers sometimes leave fields missing rather than empty, which inevitably confuses parsers. BodyTypeAttachment was an attempt to parse a common type of buggy body structure without crashing.
Currently, when Net::IMAP::ResponseParser sees “attachment” as the first entry in a
body-type-1part
, which is where the MIME type should be, it uses BodyTypeAttachment to capture the rest. “attachment” is not a valid MIME type, but is a commonContent-Disposition
. What might have happened was that buggy server could not parse the message (which might have been incorrectly formatted) and output abody-type-dsp
where a Net::IMAP::ResponseParser expected to see abody
.
A future release will replace this, probably with a ContentDisposition
nested inside another body structure object, maybe BodyTypeBasic
, or perhaps a new body structure class that represents any unparsable body structure.
Instance Attribute Summary
-
#_unused_
rw
WARNING BodyTypeAttachment represents a
body-fld-dsp
that is incorrectly in a position where the IMAP4rev1 grammar expects a nestedbody
structure. -
#dsp_type
rw
WARNING BodyTypeAttachment represents a
body-fld-dsp
that is incorrectly in a position where the IMAP4rev1 grammar expects a nestedbody
structure. - #multipart? ⇒ Boolean readonly
-
#param
rw
WARNING BodyTypeAttachment represents a
body-fld-dsp
that is incorrectly in a position where the IMAP4rev1 grammar expects a nestedbody
structure.
Instance Method Summary
-
#media_type
*invalid for BodyTypeAttachment*.
-
#subtype
*invalid for BodyTypeAttachment*.
Instance Attribute Details
#_unused_ (rw)
WARNING
BodyTypeAttachment
represents a body-fld-dsp
that is incorrectly in a position where the IMAP4rev1 grammar expects a nested body
structure.
IMAP body structures are parenthesized lists and assign their fields positionally, so missing fields change the intepretation of all following fields. Buggy IMAP servers sometimes leave fields missing rather than empty, which inevitably confuses parsers. BodyTypeAttachment was an attempt to parse a common type of buggy body structure without crashing.
Currently, when Net::IMAP::ResponseParser sees “attachment” as the first entry in a
body-type-1part
, which is where the MIME type should be, it uses BodyTypeAttachment to capture the rest. “attachment” is not a valid MIME type, but is a commonContent-Disposition
. What might have happened was that buggy server could not parse the message (which might have been incorrectly formatted) and output abody-type-dsp
where a Net::IMAP::ResponseParser expected to see abody
.
A future release will replace this, probably with a ContentDisposition
nested inside another body structure object, maybe BodyTypeBasic
, or perhaps a new body structure class that represents any unparsable body structure.
#dsp_type (rw)
WARNING
BodyTypeAttachment
represents a body-fld-dsp
that is incorrectly in a position where the IMAP4rev1 grammar expects a nested body
structure.
IMAP body structures are parenthesized lists and assign their fields positionally, so missing fields change the intepretation of all following fields. Buggy IMAP servers sometimes leave fields missing rather than empty, which inevitably confuses parsers. BodyTypeAttachment was an attempt to parse a common type of buggy body structure without crashing.
Currently, when Net::IMAP::ResponseParser sees “attachment” as the first entry in a
body-type-1part
, which is where the MIME type should be, it uses BodyTypeAttachment to capture the rest. “attachment” is not a valid MIME type, but is a commonContent-Disposition
. What might have happened was that buggy server could not parse the message (which might have been incorrectly formatted) and output abody-type-dsp
where a Net::IMAP::ResponseParser expected to see abody
.
A future release will replace this, probably with a ContentDisposition
nested inside another body structure object, maybe BodyTypeBasic
, or perhaps a new body structure class that represents any unparsable body structure.
#multipart? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/net/imap/response_data.rb', line 1188
def multipart? return false end
#param (rw)
WARNING
BodyTypeAttachment
represents a body-fld-dsp
that is incorrectly in a position where the IMAP4rev1 grammar expects a nested body
structure.
IMAP body structures are parenthesized lists and assign their fields positionally, so missing fields change the intepretation of all following fields. Buggy IMAP servers sometimes leave fields missing rather than empty, which inevitably confuses parsers. BodyTypeAttachment was an attempt to parse a common type of buggy body structure without crashing.
Currently, when Net::IMAP::ResponseParser sees “attachment” as the first entry in a
body-type-1part
, which is where the MIME type should be, it uses BodyTypeAttachment to capture the rest. “attachment” is not a valid MIME type, but is a commonContent-Disposition
. What might have happened was that buggy server could not parse the message (which might have been incorrectly formatted) and output abody-type-dsp
where a Net::IMAP::ResponseParser expected to see abody
.
A future release will replace this, probably with a ContentDisposition
nested inside another body structure object, maybe BodyTypeBasic
, or perhaps a new body structure class that represents any unparsable body structure.
Instance Method Details
#media_type
*invalid for BodyTypeAttachment*
# File 'lib/net/imap/response_data.rb', line 1160
def media_type warn(<<~WARN, uplevel: 1) BodyTypeAttachment#media_type is obsolete. Use dsp_type instead. WARN dsp_type end
#subtype
*invalid for BodyTypeAttachment*
# File 'lib/net/imap/response_data.rb', line 1168
def subtype warn("BodyTypeAttachment#subtype is obsolete.\n", uplevel: 1) nil end