Skip to content

GMail - Expose GMail labels ? #115

@mikolfaro

Description

@mikolfaro

Response supports X-GM-Labels, that is the labeling system used by GMail.
Is it possible to expose the value in Fetch?

/// Extract the `X-GM-LABELS` of a `FETCH` response
///
/// See [Access to Gmail labels: X-GM-LABELS](https://developers.google.com/gmail/imap/imap-extensions#access_to_labels_x-gm-labels)
/// for details.
pub fn gmail_labels(&self) -> Option<&Vec<Cow<'_, str>>> {
    if let Response::Fetch(_, attrs) = self.response.parsed() {
         attrs
            .iter()
             .filter_map(|av| match av {
                AttributeValue::GmailLabels(gl) => Some(gl),
                _ => None,
            })
            .next()
    } else {
         unreachable!()
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions