Skip to content

Commit

Permalink
Added MessageSummaryItems.Headers enum to fetch all headers
Browse files Browse the repository at this point in the history
Fixes #738
  • Loading branch information
jstedfast committed Jul 30, 2018
1 parent 2442abf commit 899fd9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions MailKit/MessageSummaryItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public enum MessageSummaryItems {
/// </summary>
PreviewText = 1 << 13,

/// <summary>
/// Fetch the the complete list of <see cref="IMessageSummary.Headers"/>.
/// </summary>
Headers = 1 << 14,

#region Macros

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion MailKit/Net/Imap/ImapFolderFetch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ string FormatSummaryItems (ref MessageSummaryItems items, HashSet<string> fields
tokens.Add ("X-GM-LABELS");
}

if ((items & MessageSummaryItems.References) != 0 || fields != null) {
if ((items & MessageSummaryItems.Headers) != 0) {
tokens.Add ("BODY.PEEK[HEADER]");
} else if ((items & MessageSummaryItems.References) != 0 || fields != null) {
var headers = new StringBuilder ("BODY.PEEK[HEADER.FIELDS (");
bool references = false;

Expand Down

0 comments on commit 899fd9b

Please sign in to comment.