add pseudo header if message fulfills the unusual conditions of MIME-12

MIME-12
Roker 3 years ago
parent fa3ed99d19
commit aa0dcf70a2

@ -105,7 +105,16 @@ void add_attachment(message* msg, const BodyLines& body, const MimeHeaders& mh)
LOG << "ATTACHMENT name=“" << filename << "\n";
}
const std::string content_type = mh.type + '/' + mh.subtype;
const std::string content_type = mh.mime_type();
if( (msg->attachments==nullptr) && (content_type=="message/rfc822") ) // very special requirement. See MIME-12
{
const sv forwarded = header_value( mh.tparams, "forwarded");
if(forwarded.size())
{
add_opt_field(msg, Pseudo_Header_Forwarded, forwarded);
}
}
bloblist_t* bl = bloblist_add(msg->attachments, decoded, decoded_size, content_type.c_str(), (filename.empty()? nullptr : filename.data()) );
if(msg->attachments==nullptr)
{

@ -102,7 +102,7 @@ namespace pEpMIME
extern const sv Pseudo_Header_Delsp;
// extracted from Content-Type of 1st "message/rfc822" leaf:
extern const sv Pseudo_Header_Forwared;
extern const sv Pseudo_Header_Forwarded;
} // end of namespace pEpMIME

Loading…
Cancel
Save