Fixed a bug when parsing a mailbox with no explicit email address (should be recognized as an address).
This commit is contained in:
parent
27fb7a5b96
commit
84a7adf049
@ -300,8 +300,18 @@ void mailbox::parse(const string& buffer, const string::size_type position,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
decodeAndUnfoldText(name, m_name);
|
// Swap name and address when no address was found
|
||||||
m_email = address;
|
// (email address is mandatory, whereas name is optional).
|
||||||
|
if (address.empty() && !name.empty())
|
||||||
|
{
|
||||||
|
m_email = name;
|
||||||
|
m_name.clear();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
decodeAndUnfoldText(name, m_name);
|
||||||
|
m_email = address;
|
||||||
|
}
|
||||||
|
|
||||||
if (newPosition)
|
if (newPosition)
|
||||||
*newPosition = position + (p - pstart);
|
*newPosition = position + (p - pstart);
|
||||||
|
Loading…
Reference in New Issue
Block a user