Browse Source

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

MIME-12
Roker 2 years ago
parent
commit
aa0dcf70a2
2 changed files with 11 additions and 2 deletions
  1. +10
    -1
      src/bodyparser.cc
  2. +1
    -1
      src/pEpMIME_internal.hh

+ 10
- 1
src/bodyparser.cc View File

@ -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)
{


+ 1
- 1
src/pEpMIME_internal.hh View File

@ -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