NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Connection Account API

Function to get some login credentials. More...

Functions

static const char * imap_get_field (enum ConnAccountField field, void *gf_data)
 Get connection login credentials - Implements ConnAccount::get_field() -.
 
static const char * nntp_get_field (enum ConnAccountField field, void *gf_data)
 Get connection login credentials - Implements ConnAccount::get_field() -.
 
const char * pop_get_field (enum ConnAccountField field, void *gf_data)
 Get connection login credentials - Implements ConnAccount::get_field() -.
 
static const char * smtp_get_field (enum ConnAccountField field, void *gf_data)
 Get connection login credentials - Implements ConnAccount::get_field() -.
 

Detailed Description

Function to get some login credentials.

Parameters
fieldField to get, e.g. MUTT_CA_PASS
Return values
ptrRequested string

Function Documentation

◆ imap_get_field()

static const char * imap_get_field ( enum ConnAccountField field,
void * gf_data )
static

Get connection login credentials - Implements ConnAccount::get_field() -.

Definition at line 211 of file util.c.

212{
213 switch (field)
214 {
215 case MUTT_CA_LOGIN:
216 return cs_subset_string(NeoMutt->sub, "imap_login");
217 case MUTT_CA_USER:
218 return cs_subset_string(NeoMutt->sub, "imap_user");
219 case MUTT_CA_PASS:
220 return cs_subset_string(NeoMutt->sub, "imap_pass");
222 return cs_subset_string(NeoMutt->sub, "imap_oauth_refresh_command");
223 case MUTT_CA_HOST:
224 default:
225 return NULL;
226 }
227}
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
@ MUTT_CA_OAUTH_CMD
OAuth refresh command.
Definition connaccount.h:38
@ MUTT_CA_USER
User name.
Definition connaccount.h:36
@ MUTT_CA_LOGIN
Login name.
Definition connaccount.h:35
@ MUTT_CA_HOST
Server name.
Definition connaccount.h:34
@ MUTT_CA_PASS
Password.
Definition connaccount.h:37
Container for Accounts, Notifications.
Definition neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nntp_get_field()

static const char * nntp_get_field ( enum ConnAccountField field,
void * gf_data )
static

Get connection login credentials - Implements ConnAccount::get_field() -.

Definition at line 922 of file newsrc.c.

923{
924 switch (field)
925 {
926 case MUTT_CA_LOGIN:
927 case MUTT_CA_USER:
928 return cs_subset_string(NeoMutt->sub, "nntp_user");
929 case MUTT_CA_PASS:
930 return cs_subset_string(NeoMutt->sub, "nntp_pass");
932 case MUTT_CA_HOST:
933 default:
934 return NULL;
935 }
936}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pop_get_field()

const char * pop_get_field ( enum ConnAccountField field,
void * gf_data )

Get connection login credentials - Implements ConnAccount::get_field() -.

Definition at line 56 of file lib.c.

57{
58 switch (field)
59 {
60 case MUTT_CA_LOGIN:
61 case MUTT_CA_USER:
62 return cs_subset_string(NeoMutt->sub, "pop_user");
63 case MUTT_CA_PASS:
64 return cs_subset_string(NeoMutt->sub, "pop_pass");
66 return cs_subset_string(NeoMutt->sub, "pop_oauth_refresh_command");
67 case MUTT_CA_HOST:
68 default:
69 return NULL;
70 }
71}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ smtp_get_field()

static const char * smtp_get_field ( enum ConnAccountField field,
void * gf_data )
static

Get connection login credentials - Implements ConnAccount::get_field() -.

Definition at line 332 of file smtp.c.

333{
334 struct SmtpAccountData *adata = gf_data;
335 if (!adata)
336 return NULL;
337
338 switch (field)
339 {
340 case MUTT_CA_LOGIN:
341 case MUTT_CA_USER:
342 {
343 const char *const c_smtp_user = cs_subset_string(adata->sub, "smtp_user");
344 return c_smtp_user;
345 }
346 case MUTT_CA_PASS:
347 {
348 const char *const c_smtp_pass = cs_subset_string(adata->sub, "smtp_pass");
349 return c_smtp_pass;
350 }
352 {
353 const char *const c_smtp_oauth_refresh_command = cs_subset_string(adata->sub, "smtp_oauth_refresh_command");
354 return c_smtp_oauth_refresh_command;
355 }
356 case MUTT_CA_HOST:
357 default:
358 return NULL;
359 }
360}
Server connection data.
Definition smtp.c:102
struct ConfigSubset * sub
Config scope.
Definition smtp.c:106
+ Here is the call graph for this function:
+ Here is the caller graph for this function: