From 4b1ffebaa929007c70b83abecc45108006f14aea Mon Sep 17 00:00:00 2001 From: tholdawa Date: Wed, 22 Jan 2014 11:26:57 -0800 Subject: [PATCH] IMAPMessage::processFetchResponse was attempting to set Cc and Bcc header fields to values of type mailboxList. HeaderFieldFactory registers these fields as type adddressList, so a bad_field_value_type exception was thrown when processing a fetch response for a message with either Cc or Bcc fields. Fixed by calling toAddressList on the mailboxList header field values to convert them to expected type. --- src/vmime/net/imap/IMAPMessage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vmime/net/imap/IMAPMessage.cpp b/src/vmime/net/imap/IMAPMessage.cpp index c11aafc2..226a55fe 100644 --- a/src/vmime/net/imap/IMAPMessage.cpp +++ b/src/vmime/net/imap/IMAPMessage.cpp @@ -460,14 +460,14 @@ int IMAPMessage::processFetchResponse IMAPUtils::convertAddressList(*(env->env_cc()), cc); if (!cc.isEmpty()) - hdr->Cc()->setValue(cc); + hdr->Cc()->setValue(cc.toAddressList()); // Bcc mailboxList bcc; IMAPUtils::convertAddressList(*(env->env_bcc()), bcc); if (!bcc.isEmpty()) - hdr->Bcc()->setValue(bcc); + hdr->Bcc()->setValue(bcc.toAddressList()); } break;