Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

Commented Unassigned: Issue with BodyParts parsing [1912]

$
0
0
I am trying IMAP with gmail

When the system send request for body parts
UID FETCH 25562 (BODYSTRUCTURE)

Gmail returns below body structure string which after a bit formatting should look like
* 20114 FETCH
(
UID 25562 BODYSTRUCTURE
(
(
(
(
"TEXT" "PLAIN"
(
"CHARSET" "UTF-8"
)
NIL NIL "QUOTED-PRINTABLE" 1450 60 NIL NIL NIL
)
(
"TEXT" "HTML"
(
"CHARSET" "UTF-8"
)
NIL NIL "QUOTED-PRINTABLE" 6658 147 NIL NIL NIL
)
"ALTERNATIVE"
(
"BOUNDARY" "----=_NextPart_002_03AA_01CF37DD.CB8B7C50"
)
NIL NIL
)
(
"IMAGE" "GIF"
(
"NAME" "image001.gif"
)
"<image001.gif@01CF37DD.C90FF500>" NIL "BASE64" 3970 NIL NIL NIL
)
"RELATED"
(
"BOUNDARY" "----=_NextPart_001_03A9_01CF37DD.CB8B7C50"
)
NIL NIL
)
(
"APPLICATION" "ZIP"
(
"NAME" "TEST.zip"
)
NIL NIL "BASE64" 2187248 NIL
(
"ATTACHMENT"
(
"FILENAME" "TEST.zip"
)
)
NIL
)
"MIXED"
(
"BOUNDARY" "----=_NextPart_000_03A8_01CF37DD.CB8B7C50"
)
NIL NIL
)
)


The message parts that BodyStructureParser.Parse() creates are
1.2.1
1.2.2
1.2
2

I think it should it should have been
1.1.1
1.1.2
1.2
2

Currently while fetching bodypart data for 1.2.1 & 1.2.2 returns
* 20114 FETCH (UID 25562 BODY[1.2.1] NIL BODY[1.2.1.MIME] NIL)
&
* 20114 FETCH (UID 25562 BODY[1.2.2] NIL BODY[1.2.2.MIME] NIL)

I think the issue is with computation of block in BodyStructureParser.ParsePart() the line that I think has issue is
var block = level > 2 ? level - 1 : 0;

Not sure how to fix it, Can you please help with this?
Comments: ** Comment from web user: AlexeyBo **

Hello, Pavel.

I am trying imapx with mail.ru and the result is the same: BODY[1.1] NIL.
I changed BodyStructureParser.cs and it's seems to work for me.
I tested code with some mails from gmail.com and mail.ru.


Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>