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 CONDSTORE capability as defined in
21 /// <https://tools.ietf.org/html/rfc7162>
22 pub can_condstore: bool,
23
24 /// True if the server has METADATA capability as defined in
25 /// <https://tools.ietf.org/html/rfc5464>
26 pub can_metadata: bool,
27
28 /// True if the server has COMPRESS=DEFLATE capability as defined in
29 /// <https://tools.ietf.org/html/rfc4978>
30 pub can_compress: bool,
31
32 /// True if the server supports XDELTAPUSH capability.
33 /// This capability means setting /private/devicetoken IMAP METADATA
34 /// on the INBOX results in new mail notifications
35 /// via notifications.delta.chat service.
36 /// This is supported by <https://github.com/deltachat/chatmail>
37 pub can_push: bool,
38
39 /// True if the server has an XCHATMAIL capability
40 /// indicating that it is a <https://github.com/deltachat/chatmail> server.
41 ///
42 /// This can be used to hide some advanced settings in the UI
43 /// that are only interesting for normal email accounts,
44 /// e.g. the ability to move messages to Delta Chat folder.
45 pub is_chatmail: bool,
46
47 /// Server ID if the server supports ID capability.
48 pub server_id: Option<HashMap<String, String>>,
49}