NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c File Reference

Definition of the Imap Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "config/lib.h"
#include "core/lib.h"
+ Include dependency graph for module.c:

Go to the source code of this file.

Functions

static bool imap_config_define_variables (struct NeoMutt *n, struct ConfigSet *cs)
 Define the Config Variables - Implements Module::config_define_variables()
 
static bool imap_commands_register (struct NeoMutt *n, struct CommandArray *ca)
 Register NeoMutt Commands - Implements Module::commands_register()
 

Variables

struct ConfigDef ImapVars []
 Config definitions for the IMAP library.
 
struct ConfigDef ImapVarsZlib []
 Config definitions for IMAP compression.
 
const struct Command ImapCommands []
 Imap Commands.
 
const struct Module ModuleImap
 Module for the Imap library.
 

Detailed Description

Definition of the Imap Module.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file module.c.

Function Documentation

◆ imap_config_define_variables()

static bool imap_config_define_variables ( struct NeoMutt * n,
struct ConfigSet * cs )
static

Define the Config Variables - Implements Module::config_define_variables()

Definition at line 43 of file module.c.

44{
45 bool rc = cs_register_variables(cs, ImapVars);
46
47#if defined(USE_ZLIB)
49#endif
50
51 return rc;
52}
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
struct ConfigDef ImapVars[]
Config definitions for the IMAP library.
Definition config.c:70
struct ConfigDef ImapVarsZlib[]
Config definitions for IMAP compression.
Definition config.c:146
+ Here is the call graph for this function:

◆ imap_commands_register()

static bool imap_commands_register ( struct NeoMutt * n,
struct CommandArray * ca )
static

Register NeoMutt Commands - Implements Module::commands_register()

Definition at line 57 of file module.c.

58{
60}
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
const struct Command ImapCommands[]
Imap Commands.
Definition imap.c:186
+ Here is the call graph for this function:

Variable Documentation

◆ ImapVars

struct ConfigDef ImapVars[]
extern

Config definitions for the IMAP library.

Definition at line 70 of file config.c.

70 {
71 // clang-format off
72 { "imap_check_subscribed", DT_BOOL, false, 0, NULL,
73 "(imap) When opening a mailbox, ask the server for a list of subscribed folders"
74 },
75 { "imap_condstore", DT_BOOL, false, 0, NULL,
76 "(imap) Enable the CONDSTORE extension"
77 },
78 { "imap_authenticators", DT_SLIST|D_SLIST_SEP_COLON, 0, 0, imap_auth_validator,
79 "(imap) List of allowed IMAP authentication methods (colon-separated)"
80 },
81 { "imap_delim_chars", DT_STRING, IP "/.", 0, NULL,
82 "(imap) Characters that denote separators in IMAP folders"
83 },
84 { "imap_fetch_chunk_size", DT_LONG|D_INTEGER_NOT_NEGATIVE, 0, 0, NULL,
85 "(imap) Download headers in blocks of this size"
86 },
87 { "imap_headers", DT_STRING, 0, 0, NULL,
88 "(imap) Additional email headers to download when getting index"
89 },
90 { "imap_idle", DT_BOOL, false, 0, NULL,
91 "(imap) Use the IMAP IDLE extension to check for new mail"
92 },
93 { "imap_login", DT_STRING|D_SENSITIVE, 0, 0, NULL,
94 "(imap) Login name for the IMAP server (defaults to `$imap_user`)"
95 },
96 { "imap_oauth_refresh_command", DT_STRING|D_STRING_COMMAND|D_SENSITIVE, 0, 0, NULL,
97 "(imap) External command to generate OAUTH refresh token"
98 },
99 { "imap_pass", DT_STRING|D_SENSITIVE, 0, 0, NULL,
100 "(imap) Password for the IMAP server"
101 },
102 { "imap_pipeline_depth", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 15, 0, NULL,
103 "(imap) Number of IMAP commands that may be queued up"
104 },
105 { "imap_rfc5161", DT_BOOL, true, 0, NULL,
106 "(imap) Use the IMAP ENABLE extension to select capabilities"
107 },
108 { "imap_server_noise", DT_BOOL, true, 0, NULL,
109 "(imap) Display server warnings as error messages"
110 },
111 { "imap_keep_alive", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 300, 0, NULL,
112 "(imap) Time to wait before polling an open IMAP connection"
113 },
114 { "imap_list_subscribed", DT_BOOL, false, 0, NULL,
115 "(imap) When browsing a mailbox, only display subscribed folders"
116 },
117 { "imap_passive", DT_BOOL, true, 0, NULL,
118 "(imap) Reuse an existing IMAP connection to check for new mail"
119 },
120 { "imap_peek", DT_BOOL, true, 0, NULL,
121 "(imap) Don't mark messages as read when fetching them from the server"
122 },
123 { "imap_poll_timeout", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 15, 0, NULL,
124 "(imap) Maximum time to wait for a server response"
125 },
126 { "imap_qresync", DT_BOOL, false, 0, NULL,
127 "(imap) Enable the QRESYNC extension"
128 },
129 { "imap_send_id", DT_BOOL, false, 0, NULL,
130 "(imap) Send ID command when logging in"
131 },
132 { "imap_user", DT_STRING|D_SENSITIVE, 0, 0, NULL,
133 "(imap) Username for the IMAP server"
134 },
135
136 { "imap_keepalive", DT_SYNONYM, IP "imap_keep_alive", IP "2023-05-31" },
137 { "imap_servernoise", DT_SYNONYM, IP "imap_server_noise", IP "2021-02-11" },
138 { NULL },
139 // clang-format on
140};
#define IP
Definition set.h:54
static int imap_auth_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "imap_authenticators" config variable - Implements ConfigDef::validator() -.
Definition config.c:45
#define D_SLIST_SEP_COLON
Slist items are colon-separated.
Definition types.h:112
#define D_STRING_COMMAND
A command.
Definition types.h:99
@ DT_NUMBER
a number
Definition types.h:38
@ DT_SLIST
a list of strings
Definition types.h:42
@ DT_BOOL
boolean option
Definition types.h:32
@ DT_SYNONYM
synonym for another variable
Definition types.h:45
@ DT_STRING
a string
Definition types.h:44
@ DT_LONG
a number (long)
Definition types.h:35
#define D_SENSITIVE
Contains sensitive value, e.g. password.
Definition types.h:81
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition types.h:101

◆ ImapVarsZlib

struct ConfigDef ImapVarsZlib[]
extern

Config definitions for IMAP compression.

Definition at line 146 of file config.c.

146 {
147 // clang-format off
148 { "imap_deflate", DT_BOOL, true, 0, NULL,
149 "(imap) Compress network traffic"
150 },
151 { NULL },
152 // clang-format on
153};

◆ ImapCommands

const struct Command ImapCommands[]
extern

Imap Commands.

Definition at line 186 of file imap.c.

186 {
187 // clang-format off
188 { "subscribe-to", CMD_SUBSCRIBE_TO, parse_subscribe_to,
189 N_("Subscribe to an IMAP mailbox"),
190 N_("subscribe-to <imap-folder-uri>"),
191 "optionalfeatures.html#imap" },
192 { "unsubscribe-from", CMD_UNSUBSCRIBE_FROM, parse_unsubscribe_from,
193 N_("Unsubscribe from an IMAP mailbox"),
194 N_("unsubscribe-from <imap-folder-uri>"),
195 "optionalfeatures.html#imap" },
196
197 { NULL, CMD_NONE, NULL, NULL, NULL, NULL, CF_NO_FLAGS },
198 // clang-format on
199};
#define CF_NO_FLAGS
No flags are set.
Definition command.h:48
@ CMD_UNSUBSCRIBE_FROM
:unsubscribe-from
Definition command.h:146
@ CMD_SUBSCRIBE_TO
:subscribe-to
Definition command.h:118
@ CMD_NONE
No Command.
Definition command.h:59
enum CommandResult parse_subscribe_to(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'subscribe-to' command - Implements Command::parse() -.
Definition imap.c:93
enum CommandResult parse_unsubscribe_from(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unsubscribe-from' command - Implements Command::parse() -.
Definition imap.c:143
#define N_(a)
Definition message.h:32

◆ ModuleImap

const struct Module ModuleImap
Initial value:
= {
"imap",
NULL,
NULL,
NULL,
NULL,
NULL,
}
static bool imap_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:57
static bool imap_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:43
@ MODULE_ID_IMAP
ModuleImap, Imap Mailbox
Definition module_api.h:71

Module for the Imap library.

Definition at line 65 of file module.c.

65 {
67 "imap",
68 NULL, // init
69 NULL, // config_define_types
72 NULL, // gui_init
73 NULL, // gui_cleanup
74 NULL, // cleanup
75};