Patch by Zarafa <http://www.zarafa.com/> - when constructing a plaintext only body without attachments, a copy of the body was made to set as the real body and thus removing all the multiparts. However, the same reference is removed before setting the new body, thus invalidating that body we wish to copy, possibly resulting in a crash. --- libvmime-0.7.1/src/messageBuilder.cpp 2009-09-15 22:59:21.000000000 +0200 +++ libvmime-0.7.1/src/messageBuilder.cpp.plain-bodycopy 2009-09-15 23:00:33.000000000 +0200 @@ -137,6 +137,8 @@ if (msg->getBody()->getPartCount() == 1) { const bodyPart& part = *msg->getBody()->getPartAt(0); + // make a full copy of the body, otherwise the copyFrom will delete the body we're copying + const body* bodyCopy = part.getBody()->clone(); // First, copy (and replace) the header fields const std::vector <const headerField*> fields = part.getHeader()->getFieldList(); @@ -149,7 +151,8 @@ // Second, copy the body contents and sub-parts (this also remove // the body part we are copying...) - msg->getBody()->copyFrom(*part.getBody()); + msg->getBody()->copyFrom(*bodyCopy); + delete bodyCopy; } return (msg);