diff options
| author | Vincent Richard <[email protected]> | 2008-07-11 22:45:17 +0200 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2008-07-11 22:45:17 +0200 |
| commit | a68e12235430901f71982ad2593268f38ea4b85b (patch) | |
| tree | 46494db4846a38e837f01ff3ca52081e90e65e24 /src | |
| parent | Fixed extra space in subject (see https://sourceforge.net/forum/message.php?m... (diff) | |
| download | vmime-a68e12235430901f71982ad2593268f38ea4b85b.tar.gz vmime-a68e12235430901f71982ad2593268f38ea4b85b.zip | |
Recover from broken emails without a final boundary (Zarafa).
Diffstat (limited to 'src')
| -rw-r--r-- | src/body.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/body.cpp b/src/body.cpp index a6b74a76..b9180d74 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -186,8 +186,29 @@ void body::parse(const string& buffer, const string::size_type position, m_contents = vmime::create <emptyContentHandler>(); - if (partStart < end) + // Last part was not found: recover from missing boundary + if (!lastPart && pos == string::npos) + { + ref <bodyPart> part = vmime::create <bodyPart>(); + + try + { + part->parse(buffer, partStart, end); + } + catch (std::exception&) + { + throw; + } + + part->m_parent = m_part; + + m_parts.push_back(part); + } + // Treat remaining text as epilog + else if (partStart < end) + { m_epilogText = string(buffer.begin() + partStart, buffer.begin() + end); + } } // Treat the contents as 'simple' data else |
