NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
config.c File Reference
#include "config.h"
#include <stddef.h>
#include <config/lib.h>
#include <stdbool.h>
#include "conn/lib.h"
#include "lib.h"
#include "auth.h"
#include "init.h"
+ Include dependency graph for config.c:

Go to the source code of this file.

Functions

static int imap_auth_validator (const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
 Validate the "imap_authenticators" config variable - Implements ConfigDef::validator() More...
 
bool config_init_imap (struct ConfigSet *cs)
 Register imap config variables - Implements module_init_config_t. More...
 

Variables

struct SlistC_ImapAuthenticators
 Config: (imap) List of allowed IMAP authentication methods. More...
 
bool C_ImapCheckSubscribed
 Config: (imap) When opening a mailbox, ask the server for a list of subscribed folders. More...
 
bool C_ImapCondstore
 Config: (imap) Enable the CONDSTORE extension. More...
 
bool C_ImapDeflate
 Config: (imap) Compress network traffic. More...
 
char * C_ImapDelimChars
 Config: (imap) Characters that denote separators in IMAP folders. More...
 
long C_ImapFetchChunkSize
 Config: (imap) Download headers in blocks of this size. More...
 
char * C_ImapHeaders
 Config: (imap) Additional email headers to download when getting index. More...
 
bool C_ImapIdle
 Config: (imap) Use the IMAP IDLE extension to check for new mail. More...
 
short C_ImapKeepalive
 Config: (imap) Time to wait before polling an open IMAP connection. More...
 
bool C_ImapListSubscribed
 Config: (imap) When browsing a mailbox, only display subscribed folders. More...
 
char * C_ImapLogin
 Config: (imap) Login name for the IMAP server (defaults to $imap_user) More...
 
char * C_ImapOauthRefreshCommand
 Config: (imap) External command to generate OAUTH refresh token. More...
 
char * C_ImapPass
 Config: (imap) Password for the IMAP server. More...
 
bool C_ImapPassive
 Config: (imap) Reuse an existing IMAP connection to check for new mail. More...
 
bool C_ImapPeek
 Config: (imap) Don't mark messages as read when fetching them from the server. More...
 
short C_ImapPipelineDepth
 Config: (imap) Number of IMAP commands that may be queued up. More...
 
short C_ImapPollTimeout
 Config: (imap) Maximum time to wait for a server response. More...
 
bool C_ImapQresync
 Config: (imap) Enable the QRESYNC extension. More...
 
bool C_ImapRfc5161
 Config: (imap) Use the IMAP ENABLE extension to select capabilities. More...
 
bool C_ImapServerNoise
 Config: (imap) Display server warnings as error messages. More...
 
char * C_ImapUser
 Config: (imap) Username for the IMAP server. More...
 
struct ConfigDef ImapVars []
 

Detailed Description

Config used by libimap

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 config.c.

Function Documentation

◆ imap_auth_validator()

static int imap_auth_validator ( const struct ConfigSet cs,
const struct ConfigDef cdef,
intptr_t  value,
struct Buffer err 
)
static

Validate the "imap_authenticators" config variable - Implements ConfigDef::validator()

Definition at line 67 of file config.c.

69 {
70  const struct Slist *imap_auth_methods = (const struct Slist *) value;
71  if (!imap_auth_methods || (imap_auth_methods->count == 0))
72  return CSR_SUCCESS;
73 
74  struct ListNode *np = NULL;
75  STAILQ_FOREACH(np, &imap_auth_methods->head, entries)
76  {
77  if (imap_auth_is_valid(np->data))
78  continue;
79 #ifdef USE_SASL
80  if (sasl_auth_validator(np->data))
81  continue;
82 #endif
83  mutt_buffer_printf(err, _("Option %s: %s is not a valid authenticator"),
84  cdef->name, np->data);
85  return CSR_ERR_INVALID;
86  }
87 
88  return CSR_SUCCESS;
89 }
+ Here is the call graph for this function:

◆ config_init_imap()

bool config_init_imap ( struct ConfigSet cs)

Register imap config variables - Implements module_init_config_t.

Definition at line 167 of file config.c.

168 {
169  return cs_register_variables(cs, ImapVars, 0);
170 }
+ Here is the call graph for this function:

Variable Documentation

◆ C_ImapAuthenticators

struct Slist* C_ImapAuthenticators

Config: (imap) List of allowed IMAP authentication methods.

Definition at line 39 of file config.c.

◆ C_ImapCheckSubscribed

bool C_ImapCheckSubscribed

Config: (imap) When opening a mailbox, ask the server for a list of subscribed folders.

Definition at line 40 of file config.c.

◆ C_ImapCondstore

bool C_ImapCondstore

Config: (imap) Enable the CONDSTORE extension.

Definition at line 41 of file config.c.

◆ C_ImapDeflate

bool C_ImapDeflate

Config: (imap) Compress network traffic.

Definition at line 43 of file config.c.

◆ C_ImapDelimChars

char* C_ImapDelimChars

Config: (imap) Characters that denote separators in IMAP folders.

Definition at line 45 of file config.c.

◆ C_ImapFetchChunkSize

long C_ImapFetchChunkSize

Config: (imap) Download headers in blocks of this size.

Definition at line 46 of file config.c.

◆ C_ImapHeaders

char* C_ImapHeaders

Config: (imap) Additional email headers to download when getting index.

Definition at line 47 of file config.c.

◆ C_ImapIdle

bool C_ImapIdle

Config: (imap) Use the IMAP IDLE extension to check for new mail.

Definition at line 48 of file config.c.

◆ C_ImapKeepalive

short C_ImapKeepalive

Config: (imap) Time to wait before polling an open IMAP connection.

Definition at line 49 of file config.c.

◆ C_ImapListSubscribed

bool C_ImapListSubscribed

Config: (imap) When browsing a mailbox, only display subscribed folders.

Definition at line 50 of file config.c.

◆ C_ImapLogin

char* C_ImapLogin

Config: (imap) Login name for the IMAP server (defaults to $imap_user)

Definition at line 51 of file config.c.

◆ C_ImapOauthRefreshCommand

char* C_ImapOauthRefreshCommand

Config: (imap) External command to generate OAUTH refresh token.

Definition at line 52 of file config.c.

◆ C_ImapPass

char* C_ImapPass

Config: (imap) Password for the IMAP server.

Definition at line 53 of file config.c.

◆ C_ImapPassive

bool C_ImapPassive

Config: (imap) Reuse an existing IMAP connection to check for new mail.

Definition at line 54 of file config.c.

◆ C_ImapPeek

bool C_ImapPeek

Config: (imap) Don't mark messages as read when fetching them from the server.

Definition at line 55 of file config.c.

◆ C_ImapPipelineDepth

short C_ImapPipelineDepth

Config: (imap) Number of IMAP commands that may be queued up.

Definition at line 56 of file config.c.

◆ C_ImapPollTimeout

short C_ImapPollTimeout

Config: (imap) Maximum time to wait for a server response.

Definition at line 57 of file config.c.

◆ C_ImapQresync

bool C_ImapQresync

Config: (imap) Enable the QRESYNC extension.

Definition at line 58 of file config.c.

◆ C_ImapRfc5161

bool C_ImapRfc5161

Config: (imap) Use the IMAP ENABLE extension to select capabilities.

Definition at line 59 of file config.c.

◆ C_ImapServerNoise

bool C_ImapServerNoise

Config: (imap) Display server warnings as error messages.

Definition at line 60 of file config.c.

◆ C_ImapUser

char* C_ImapUser

Config: (imap) Username for the IMAP server.

Definition at line 61 of file config.c.

◆ ImapVars

struct ConfigDef ImapVars[]

Definition at line 91 of file config.c.

sasl_auth_validator
bool sasl_auth_validator(const char *authenticator)
Validate an auth method against Cyrus SASL methods.
Definition: sasl.c:127
_
#define _(a)
Definition: message.h:28
ListNode
A List node for strings.
Definition: list.h:34
CSR_SUCCESS
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
Slist::head
struct ListHead head
Definition: slist.h:48
cs_register_variables
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], uint32_t flags)
Register a set of config items.
Definition: set.c:286
STAILQ_FOREACH
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:349
ConfigDef::name
const char * name
User-visible name.
Definition: set.h:63
ImapVars
struct ConfigDef ImapVars[]
Definition: config.c:91
Slist::count
size_t count
Definition: slist.h:49
ListNode::data
char * data
String.
Definition: list.h:36
CSR_ERR_INVALID
#define CSR_ERR_INVALID
Value hasn't been set.
Definition: set.h:38
imap_auth_is_valid
bool imap_auth_is_valid(const char *authenticator)
Check if string is a valid imap authentication method.
Definition: auth.c:85
mutt_buffer_printf
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:160
Slist
String list.
Definition: slist.h:46