-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TIdIMAP4.InternalRetrieveText() does not retreive text correctly #368
Labels
Element: IMAP4
Issues related to TIdIMAP4 and TIdIMAP4Server
Status: Review Needed
Issue needs further review to decide next status
Type: Bug
Issue is a bug in existing code
Comments
rlebeau
added
Type: Bug
Issue is a bug in existing code
Element: IMAP4
Issues related to TIdIMAP4 and TIdIMAP4Server
labels
Jul 27, 2021
rlebeau
added a commit
that referenced
this issue
Jul 27, 2021
…tual IMAP PartNumber instead of Index 1 when AUseFirstPartInsteadOfText is True.
below snippet code in InternalRetrieveText() is the bug. because it assume that MIME parts are flat whereas they have tree structure.
To retrieve text part only I propose this:
|
rlebeau
added
the
Status: Review Needed
Issue needs further review to decide next status
label
Apr 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Element: IMAP4
Issues related to TIdIMAP4 and TIdIMAP4Server
Status: Review Needed
Issue needs further review to decide next status
Type: Bug
Issue is a bug in existing code
When
InternalRetrieveText()
is called withAUseFirstPartInsteadOfText=true
, it calls(UID)RetrieveStructure()
, which may return text parts that haveTIdImapMessagePart.ImapPartNumber
set to an empty string, whichInternalRetrieveText()
is not accounting for.For example:
In this case, the local
TIdImapMessageParts
is being populated like this:InternalRetrieveText()
decides to request thetext/plain
text part, so it requestsBODY.PEEK[2]
where2
isindex 1
, but that is actually requesting thetext/html
text part instead. And since thetext/plain
text part has a transfer-encoding of8BIT
,InternalRetrieveText()
does not attempt to QuotedPrintable-decode the text that it retreived.InternalRetrieveText()
should be using the actualImapPartNumber
, notindex 1
.The text was updated successfully, but these errors were encountered: