aboutsummaryrefslogtreecommitdiffstats
path: root/src/mailbox.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2011-06-19 18:49:55 +0000
committerVincent Richard <[email protected]>2011-06-19 18:49:55 +0000
commit4f9dc93200616f11db6935f439c47252de5674d3 (patch)
treed09b8ca4a00b55166d99125431b0884a5d140b7c /src/mailbox.cpp
parentFixed messageBuilder to accept an empty mailbox group in 'To:' field, to allo... (diff)
downloadvmime-4f9dc93200616f11db6935f439c47252de5674d3.tar.gz
vmime-4f9dc93200616f11db6935f439c47252de5674d3.zip
Added support for mailboxes that specify an (encoded) full name with an empty email address, set by a <> marker (Zarafa).
Diffstat (limited to 'src/mailbox.cpp')
-rw-r--r--src/mailbox.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index 5cb0139d..fea74797 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -88,6 +88,7 @@ void mailbox::parse(const string& buffer, const string::size_type position,
// Temporary buffers for extracted name and address
string name;
string address;
+ bool hadBrackets = false;
while (p < pend)
{
@@ -283,6 +284,7 @@ void mailbox::parse(const string& buffer, const string::size_type position,
}
else if (*p == '>')
{
+ hadBrackets = true;
break;
}
else if (!parserHelpers::isSpace(*p))
@@ -309,7 +311,7 @@ void mailbox::parse(const string& buffer, const string::size_type position,
// Swap name and address when no address was found
// (email address is mandatory, whereas name is optional).
- if (address.empty() && !name.empty())
+ if (address.empty() && !name.empty() && !hadBrackets)
{
m_email.clear();
m_email.reserve(name.size());