Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

IMAPMessage::extract() does not extract headers #10

Closed
gsauthof opened this Issue · 2 comments

2 participants

@gsauthof

IMAPMessage::extract() should extract the whole message but with libvmime 0.9.2 and current git it does not. It just extracts the body.

The API doc says:

Extract the whole message data (header + contents).

But a call like

vmime::utility::outputStreamByteArrayAdapter out(raw_arr);
msg->extract(out);

yields following IMAP command:

FETCH 1 BODY[TEXT]

And according to RFC 3501:

The TEXT part specifier refers to the text body of the message,
omitting the RFC-2822 header.

The old libvmime 0.8.1 code yields:

FETCH 1 BODY[]

which works as expected because:

An empty section
specification refers to the entire message, including the
header.

(again RFC 3501)

This is a regression. Is used to work with libvmime 0.8.1 and 0.9svn.

For a real example, where the regression introduces a bug see mailcp.

@gsauthof

Btw, to work around this issue I wrote following trivial patch:

--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -280,7 +281,7 @@ void IMAPMessage::extract(ref <const part> p, utility::outputStream& os,
                if (headerOnly)
                        command << "HEADER";
                else
-                       command << "TEXT";
+                       ; //command << "TEXT";
        }
        else
        {
@vincent-richard

Thank you, I fixed that in the git repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.