Skip to main content

deltachat/imap/
capabilities.rs

1//! # IMAP capabilities
2//!
3//! IMAP server capabilities are determined with a `CAPABILITY` command.
4use std::collections::HashMap;
5
6#[derive(Debug)]
7pub(crate) struct Capabilities {
8    /// True if the server has IDLE capability as defined in
9    /// <https://tools.ietf.org/html/rfc2177>
10    pub can_idle: bool,
11
12    /// True if the server has MOVE capability as defined in
13    /// <https://tools.ietf.org/html/rfc6851>
14    pub can_move: bool,
15
16    /// True if the server has QUOTA capability as defined in
17    /// <https://tools.ietf.org/html/rfc2087>
18    pub can_check_quota: bool,
19
20    /// True if the server has METADATA capability as defined in
21    /// <https://tools.ietf.org/html/rfc5464>
22    pub can_metadata: bool,
23
24    /// True if the server has COMPRESS=DEFLATE capability as defined in
25    /// <https://tools.ietf.org/html/rfc4978>
26    pub can_compress: bool,
27
28    /// True if the server supports XDELTAPUSH capability.
29    /// This capability means setting /private/devicetoken IMAP METADATA
30    /// on the INBOX results in new mail notifications
31    /// via notifications.delta.chat service.
32    /// This is supported by <https://github.com/deltachat/chatmail>
33    pub can_push: bool,
34
35    /// True if the server has an XCHATMAIL capability
36    /// indicating that it is a <https://github.com/deltachat/chatmail> server.
37    ///
38    /// This can be used to hide some advanced settings in the UI
39    /// that are only interesting for normal email accounts,
40    /// e.g. the ability to move messages to Delta Chat folder.
41    pub is_chatmail: bool,
42
43    /// Server ID if the server supports ID capability.
44    pub server_id: Option<HashMap<String, String>>,
45}