mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 02:06:04 +02:00
fixed #848: MailMessage::_encoding is not set when retrieving plain/text message
This commit is contained in:
@@ -486,29 +486,36 @@ void MailMessage::readMultipart(std::istream& istr, PartHandler& handler)
|
|||||||
|
|
||||||
void MailMessage::readPart(std::istream& istr, const MessageHeader& header, PartHandler& handler)
|
void MailMessage::readPart(std::istream& istr, const MessageHeader& header, PartHandler& handler)
|
||||||
{
|
{
|
||||||
std::string encoding;
|
std::string encoding;
|
||||||
if (header.has(HEADER_CONTENT_TRANSFER_ENCODING))
|
if (header.has(HEADER_CONTENT_TRANSFER_ENCODING))
|
||||||
{
|
{
|
||||||
encoding = header.get(HEADER_CONTENT_TRANSFER_ENCODING);
|
encoding = header.get(HEADER_CONTENT_TRANSFER_ENCODING);
|
||||||
// get rid of a parameter if one is set
|
// get rid of a parameter if one is set
|
||||||
std::string::size_type pos = encoding.find(';');
|
std::string::size_type pos = encoding.find(';');
|
||||||
if (pos != std::string::npos)
|
if (pos != std::string::npos)
|
||||||
encoding.resize(pos);
|
encoding.resize(pos);
|
||||||
}
|
}
|
||||||
if (icompare(encoding, CTE_QUOTED_PRINTABLE) == 0)
|
if (icompare(encoding, CTE_QUOTED_PRINTABLE) == 0)
|
||||||
{
|
{
|
||||||
QuotedPrintableDecoder decoder(istr);
|
QuotedPrintableDecoder decoder(istr);
|
||||||
handlePart(decoder, header, handler);
|
handlePart(decoder, header, handler);
|
||||||
}
|
_encoding = ENCODING_QUOTED_PRINTABLE;
|
||||||
else if (icompare(encoding, CTE_BASE64) == 0)
|
}
|
||||||
{
|
else if (icompare(encoding, CTE_BASE64) == 0)
|
||||||
Base64Decoder decoder(istr);
|
{
|
||||||
handlePart(decoder, header, handler);
|
Base64Decoder decoder(istr);
|
||||||
}
|
handlePart(decoder, header, handler);
|
||||||
else
|
_encoding = ENCODING_BASE64;
|
||||||
{
|
}
|
||||||
handlePart(istr, header, handler);
|
else
|
||||||
}
|
{
|
||||||
|
if (icompare(encoding, CTE_7BIT) == 0)
|
||||||
|
_encoding = ENCODING_7BIT;
|
||||||
|
else if (icompare(encoding, CTE_8BIT) == 0)
|
||||||
|
_encoding = ENCODING_8BIT;
|
||||||
|
|
||||||
|
handlePart(istr, header, handler);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user