diff options
Diffstat (limited to 'src/messaging/imap/IMAPMessage.cpp')
-rw-r--r-- | src/messaging/imap/IMAPMessage.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/messaging/imap/IMAPMessage.cpp b/src/messaging/imap/IMAPMessage.cpp index bbda8386..ba77251b 100644 --- a/src/messaging/imap/IMAPMessage.cpp +++ b/src/messaging/imap/IMAPMessage.cpp @@ -492,8 +492,32 @@ void IMAPMessage::fetch(IMAPFolder* folder, const int options) if (options & folder::FETCH_ENVELOPE) items.push_back("ENVELOPE"); + std::vector <string> headerFields; + if (options & folder::FETCH_CONTENT_INFO) - items.push_back("BODY[HEADER.FIELDS (CONTENT-TYPE)]"); + headerFields.push_back("CONTENT_TYPE"); + + if (options & folder::FETCH_IMPORTANCE) + { + headerFields.push_back("IMPORTANCE"); + headerFields.push_back("X-PRIORITY"); + } + + if (!headerFields.empty()) + { + string list; + + for (std::vector <string>::iterator it = headerFields.begin() ; + it != headerFields.end() ; ++it) + { + if (it != headerFields.begin()) + list += " "; + + list += *it; + } + + items.push_back("BODY[HEADER.FIELDS (" + list + ")]"); + } } // Build the request text |