NeoMutt  2019-12-07-60-g0cfa53
Teaching an old dog new tricks
DOXYGEN
mutt_account.c File Reference

ConnAccount object used by POP and IMAP. More...

#include "config.h"
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include "mutt/mutt.h"
#include "email/lib.h"
#include "conn/conn.h"
#include "gui/lib.h"
#include "mutt.h"
#include "mutt_account.h"
#include "filter.h"
#include "globals.h"
#include "options.h"
+ Include dependency graph for mutt_account.c:

Go to the source code of this file.

Functions

bool mutt_account_match (const struct ConnAccount *a1, const struct ConnAccount *a2)
 Compare account info (host/port/user) More...
 
int mutt_account_fromurl (struct ConnAccount *account, const struct Url *url)
 Fill ConnAccount with information from url. More...
 
void mutt_account_tourl (struct ConnAccount *account, struct Url *url)
 Fill URL with info from account. More...
 
int mutt_account_getuser (struct ConnAccount *account)
 Retrieve username into ConnAccount, if necessary. More...
 
int mutt_account_getlogin (struct ConnAccount *account)
 Retrieve login info into ConnAccount, if necessary. More...
 
int mutt_account_getpass (struct ConnAccount *account)
 Fetch password into ConnAccount, if necessary. More...
 
void mutt_account_unsetpass (struct ConnAccount *account)
 Unset ConnAccount's password. More...
 
char * mutt_account_getoauthbearer (struct ConnAccount *account)
 Get an OAUTHBEARER token. More...
 

Variables

char * C_ImapLogin
 Config: (imap) Login name for the IMAP server (defaults to C_ImapUser) 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...
 
char * C_NntpPass
 Config: (nntp) Password for the news server. More...
 
char * C_NntpUser
 Config: (nntp) Username for the news server. More...
 
char * C_PopOauthRefreshCommand
 Config: (pop) External command to generate OAUTH refresh token. More...
 
char * C_PopPass
 Config: (pop) Password of the POP server. More...
 
char * C_PopUser
 Config: (pop) Username of the POP server. More...
 
char * C_SmtpOauthRefreshCommand
 Config: (smtp) External command to generate OAUTH refresh token. More...
 
char * C_SmtpPass
 Config: (smtp) Password for the SMTP server. More...
 

Detailed Description

ConnAccount object used by POP and IMAP.

Authors
  • Brendan Cully

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

Function Documentation

◆ mutt_account_match()

bool mutt_account_match ( const struct ConnAccount a1,
const struct ConnAccount a2 
)

Compare account info (host/port/user)

Parameters
a1First ConnAccount
a2Second ConnAccount
Return values
trueAccounts match

Definition at line 61 of file mutt_account.c.

62 {
63  if (a1->type != a2->type)
64  return false;
65  if (mutt_str_strcasecmp(a1->host, a2->host) != 0)
66  return false;
67  if (a1->port != a2->port)
68  return false;
69  if (a1->flags & a2->flags & MUTT_ACCT_USER)
70  return strcmp(a1->user, a2->user) == 0;
71 
72 #ifdef USE_NNTP
73  if (a1->type == MUTT_ACCT_TYPE_NNTP)
74  return (a1->flags & MUTT_ACCT_USER) && (a1->user[0] != '\0') ? false : true;
75 #endif
76 
77  const char *user = NONULL(Username);
78 
79 #ifdef USE_IMAP
80  if ((a1->type == MUTT_ACCT_TYPE_IMAP) && C_ImapUser)
81  user = C_ImapUser;
82 #endif
83 
84 #ifdef USE_POP
85  if ((a1->type == MUTT_ACCT_TYPE_POP) && C_PopUser)
86  user = C_PopUser;
87 #endif
88 
89 #ifdef USE_NNTP
90  if ((a1->type == MUTT_ACCT_TYPE_NNTP) && C_NntpUser)
91  user = C_NntpUser;
92 #endif
93 
94  if (a1->flags & MUTT_ACCT_USER)
95  return strcmp(a1->user, user) == 0;
96  if (a2->flags & MUTT_ACCT_USER)
97  return strcmp(a2->user, user) == 0;
98 
99  return true;
100 }
WHERE char * Username
User&#39;s login name.
Definition: globals.h:52
#define NONULL(x)
Definition: string2.h:37
char user[128]
Definition: connaccount.h:33
WHERE char * C_ImapUser
Config: (imap) Username for the IMAP server.
Definition: globals.h:115
char host[128]
Definition: connaccount.h:36
unsigned short port
Definition: connaccount.h:37
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:38
Imap Account.
Definition: mutt_account.h:52
char * C_NntpUser
Config: (nntp) Username for the news server.
Definition: mutt_account.c:48
Nntp (Usenet) Account.
Definition: mutt_account.h:55
Pop Account.
Definition: mutt_account.h:53
int mutt_str_strcasecmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition: string.c:628
char * C_PopUser
Config: (pop) Username of the POP server.
Definition: mutt_account.c:51
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:39
#define MUTT_ACCT_USER
User field has been set.
Definition: mutt_account.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_account_fromurl()

int mutt_account_fromurl ( struct ConnAccount account,
const struct Url url 
)

Fill ConnAccount with information from url.

Parameters
accountConnAccount to fill
urlUrl to parse
Return values
0Success
-1Error

Definition at line 109 of file mutt_account.c.

110 {
111  /* must be present */
112  if (url->host)
113  mutt_str_strfcpy(account->host, url->host, sizeof(account->host));
114  else
115  return -1;
116 
117  if (url->user)
118  {
119  mutt_str_strfcpy(account->user, url->user, sizeof(account->user));
120  account->flags |= MUTT_ACCT_USER;
121  }
122  if (url->pass)
123  {
124  mutt_str_strfcpy(account->pass, url->pass, sizeof(account->pass));
125  account->flags |= MUTT_ACCT_PASS;
126  }
127  if (url->port)
128  {
129  account->port = url->port;
130  account->flags |= MUTT_ACCT_PORT;
131  }
132 
133  return 0;
134 }
char * pass
Password.
Definition: url.h:70
char user[128]
Definition: connaccount.h:33
char host[128]
Definition: connaccount.h:36
#define MUTT_ACCT_PASS
Password field has been set.
Definition: mutt_account.h:63
char pass[256]
Definition: connaccount.h:35
unsigned short port
Definition: connaccount.h:37
#define MUTT_ACCT_PORT
Port field has been set.
Definition: mutt_account.h:60
char * user
Username.
Definition: url.h:69
size_t mutt_str_strfcpy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:750
char * host
Host.
Definition: url.h:71
unsigned short port
Port.
Definition: url.h:72
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:39
#define MUTT_ACCT_USER
User field has been set.
Definition: mutt_account.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_account_tourl()

void mutt_account_tourl ( struct ConnAccount account,
struct Url url 
)

Fill URL with info from account.

Parameters
accountSource ConnAccount
urlUrl to fill

The URL information is a set of pointers into account - don't free or edit account until you've finished with url (make a copy of account if you need it for a while).

Definition at line 145 of file mutt_account.c.

146 {
147  url->scheme = U_UNKNOWN;
148  url->user = NULL;
149  url->pass = NULL;
150  url->port = 0;
151  url->path = NULL;
152 
153 #ifdef USE_IMAP
154  if (account->type == MUTT_ACCT_TYPE_IMAP)
155  {
156  if (account->flags & MUTT_ACCT_SSL)
157  url->scheme = U_IMAPS;
158  else
159  url->scheme = U_IMAP;
160  }
161 #endif
162 
163 #ifdef USE_POP
164  if (account->type == MUTT_ACCT_TYPE_POP)
165  {
166  if (account->flags & MUTT_ACCT_SSL)
167  url->scheme = U_POPS;
168  else
169  url->scheme = U_POP;
170  }
171 #endif
172 
173 #ifdef USE_SMTP
174  if (account->type == MUTT_ACCT_TYPE_SMTP)
175  {
176  if (account->flags & MUTT_ACCT_SSL)
177  url->scheme = U_SMTPS;
178  else
179  url->scheme = U_SMTP;
180  }
181 #endif
182 
183 #ifdef USE_NNTP
184  if (account->type == MUTT_ACCT_TYPE_NNTP)
185  {
186  if (account->flags & MUTT_ACCT_SSL)
187  url->scheme = U_NNTPS;
188  else
189  url->scheme = U_NNTP;
190  }
191 #endif
192 
193  url->host = account->host;
194  if (account->flags & MUTT_ACCT_PORT)
195  url->port = account->port;
196  if (account->flags & MUTT_ACCT_USER)
197  url->user = account->user;
198  if (account->flags & MUTT_ACCT_PASS)
199  url->pass = account->pass;
200 }
char * pass
Password.
Definition: url.h:70
enum UrlScheme scheme
Scheme, e.g. U_SMTPS.
Definition: url.h:68
Url is imaps://.
Definition: url.h:39
char user[128]
Definition: connaccount.h:33
Url wasn&#39;t recognised.
Definition: url.h:34
Url is imap://.
Definition: url.h:38
char host[128]
Definition: connaccount.h:36
#define MUTT_ACCT_PASS
Password field has been set.
Definition: mutt_account.h:63
char pass[256]
Definition: connaccount.h:35
Url is nntps://.
Definition: url.h:41
unsigned short port
Definition: connaccount.h:37
#define MUTT_ACCT_PORT
Port field has been set.
Definition: mutt_account.h:60
char * user
Username.
Definition: url.h:69
Url is smtps://.
Definition: url.h:43
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:38
char * host
Host.
Definition: url.h:71
Imap Account.
Definition: mutt_account.h:52
char * path
Path.
Definition: url.h:73
Nntp (Usenet) Account.
Definition: mutt_account.h:55
Pop Account.
Definition: mutt_account.h:53
Url is pop://.
Definition: url.h:36
unsigned short port
Port.
Definition: url.h:72
Url is nntp://.
Definition: url.h:40
Url is smtp://.
Definition: url.h:42
#define MUTT_ACCT_SSL
Account uses SSL/TLS.
Definition: mutt_account.h:64
Smtp Account.
Definition: mutt_account.h:54
Url is pops://.
Definition: url.h:37
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:39
#define MUTT_ACCT_USER
User field has been set.
Definition: mutt_account.h:61
+ Here is the caller graph for this function:

◆ mutt_account_getuser()

int mutt_account_getuser ( struct ConnAccount account)

Retrieve username into ConnAccount, if necessary.

Parameters
accountConnAccount to fill
Return values
0Success
-1Failure

Definition at line 208 of file mutt_account.c.

209 {
210  char prompt[256];
211 
212  /* already set */
213  if (account->flags & MUTT_ACCT_USER)
214  return 0;
215 #ifdef USE_IMAP
216  else if ((account->type == MUTT_ACCT_TYPE_IMAP) && C_ImapUser)
217  mutt_str_strfcpy(account->user, C_ImapUser, sizeof(account->user));
218 #endif
219 #ifdef USE_POP
220  else if ((account->type == MUTT_ACCT_TYPE_POP) && C_PopUser)
221  mutt_str_strfcpy(account->user, C_PopUser, sizeof(account->user));
222 #endif
223 #ifdef USE_NNTP
224  else if ((account->type == MUTT_ACCT_TYPE_NNTP) && C_NntpUser)
225  mutt_str_strfcpy(account->user, C_NntpUser, sizeof(account->user));
226 #endif
227  else if (OptNoCurses)
228  return -1;
229  /* prompt (defaults to unix username), copy into account->user */
230  else
231  {
232  /* L10N: Example: Username at myhost.com */
233  snprintf(prompt, sizeof(prompt), _("Username at %s: "), account->host);
234  mutt_str_strfcpy(account->user, Username, sizeof(account->user));
235  if (mutt_get_field_unbuffered(prompt, account->user, sizeof(account->user), MUTT_COMP_NO_FLAGS))
236  return -1;
237  }
238 
239  account->flags |= MUTT_ACCT_USER;
240 
241  return 0;
242 }
WHERE char * Username
User&#39;s login name.
Definition: globals.h:52
char user[128]
Definition: connaccount.h:33
#define _(a)
Definition: message.h:28
WHERE char * C_ImapUser
Config: (imap) Username for the IMAP server.
Definition: globals.h:115
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:46
char host[128]
Definition: connaccount.h:36
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition: mutt.h:62
size_t mutt_str_strfcpy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:750
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:38
Imap Account.
Definition: mutt_account.h:52
int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, CompletionFlags flags)
Ask the user for a string (ignoring macro buffer)
Definition: curs_lib.c:331
char * C_NntpUser
Config: (nntp) Username for the news server.
Definition: mutt_account.c:48
Nntp (Usenet) Account.
Definition: mutt_account.h:55
Pop Account.
Definition: mutt_account.h:53
char * C_PopUser
Config: (pop) Username of the POP server.
Definition: mutt_account.c:51
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:39
#define MUTT_ACCT_USER
User field has been set.
Definition: mutt_account.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_account_getlogin()

int mutt_account_getlogin ( struct ConnAccount account)

Retrieve login info into ConnAccount, if necessary.

Parameters
accountConnAccount to fill
Return values
0Success
-1Failure

Definition at line 250 of file mutt_account.c.

251 {
252  /* already set */
253  if (account->flags & MUTT_ACCT_LOGIN)
254  return 0;
255 #ifdef USE_IMAP
256  if (account->type == MUTT_ACCT_TYPE_IMAP)
257  {
258  if (C_ImapLogin)
259  {
260  mutt_str_strfcpy(account->login, C_ImapLogin, sizeof(account->login));
261  account->flags |= MUTT_ACCT_LOGIN;
262  }
263  }
264 #endif
265 
266  if (!(account->flags & MUTT_ACCT_LOGIN))
267  {
268  if (mutt_account_getuser(account) == 0)
269  {
270  mutt_str_strfcpy(account->login, account->user, sizeof(account->login));
271  account->flags |= MUTT_ACCT_LOGIN;
272  }
273  else
274  {
275  mutt_debug(LL_DEBUG1, "Couldn't get user info\n");
276  return -1;
277  }
278  }
279 
280  return 0;
281 }
char login[128]
Definition: connaccount.h:34
#define MUTT_ACCT_LOGIN
Login field has been set.
Definition: mutt_account.h:62
char user[128]
Definition: connaccount.h:33
char * C_ImapLogin
Config: (imap) Login name for the IMAP server (defaults to C_ImapUser)
Definition: mutt_account.c:44
int mutt_account_getuser(struct ConnAccount *account)
Retrieve username into ConnAccount, if necessary.
Definition: mutt_account.c:208
size_t mutt_str_strfcpy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:750
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:38
Imap Account.
Definition: mutt_account.h:52
Log at debug level 1.
Definition: logging.h:40
#define mutt_debug(LEVEL,...)
Definition: logging.h:81
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_account_getpass()

int mutt_account_getpass ( struct ConnAccount account)

Fetch password into ConnAccount, if necessary.

Parameters
accountConnAccount to fill
Return values
0Success
-1Failure

Definition at line 289 of file mutt_account.c.

290 {
291  char prompt[256];
292 
293  if (account->flags & MUTT_ACCT_PASS)
294  return 0;
295 #ifdef USE_IMAP
296  else if ((account->type == MUTT_ACCT_TYPE_IMAP) && C_ImapPass)
297  mutt_str_strfcpy(account->pass, C_ImapPass, sizeof(account->pass));
298 #endif
299 #ifdef USE_POP
300  else if ((account->type == MUTT_ACCT_TYPE_POP) && C_PopPass)
301  mutt_str_strfcpy(account->pass, C_PopPass, sizeof(account->pass));
302 #endif
303 #ifdef USE_SMTP
304  else if ((account->type == MUTT_ACCT_TYPE_SMTP) && C_SmtpPass)
305  mutt_str_strfcpy(account->pass, C_SmtpPass, sizeof(account->pass));
306 #endif
307 #ifdef USE_NNTP
308  else if ((account->type == MUTT_ACCT_TYPE_NNTP) && C_NntpPass)
309  mutt_str_strfcpy(account->pass, C_NntpPass, sizeof(account->pass));
310 #endif
311  else if (OptNoCurses)
312  return -1;
313  else
314  {
315  snprintf(prompt, sizeof(prompt), _("Password for %s@%s: "),
316  (account->flags & MUTT_ACCT_LOGIN) ? account->login : account->user,
317  account->host);
318  account->pass[0] = '\0';
319  if (mutt_get_password(prompt, account->pass, sizeof(account->pass)))
320  return -1;
321  }
322 
323  account->flags |= MUTT_ACCT_PASS;
324 
325  return 0;
326 }
char login[128]
Definition: connaccount.h:34
#define MUTT_ACCT_LOGIN
Login field has been set.
Definition: mutt_account.h:62
#define mutt_get_password(msg, buf, buflen)
Definition: curs_lib.h:93
char user[128]
Definition: connaccount.h:33
#define _(a)
Definition: message.h:28
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:46
char host[128]
Definition: connaccount.h:36
#define MUTT_ACCT_PASS
Password field has been set.
Definition: mutt_account.h:63
char * C_ImapPass
Config: (imap) Password for the IMAP server.
Definition: mutt_account.c:46
char * C_SmtpPass
Config: (smtp) Password for the SMTP server.
Definition: mutt_account.c:53
char pass[256]
Definition: connaccount.h:35
size_t mutt_str_strfcpy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:750
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:38
char * C_NntpPass
Config: (nntp) Password for the news server.
Definition: mutt_account.c:47
Imap Account.
Definition: mutt_account.h:52
Nntp (Usenet) Account.
Definition: mutt_account.h:55
Pop Account.
Definition: mutt_account.h:53
Smtp Account.
Definition: mutt_account.h:54
char * C_PopPass
Config: (pop) Password of the POP server.
Definition: mutt_account.c:50
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_account_unsetpass()

void mutt_account_unsetpass ( struct ConnAccount account)

Unset ConnAccount's password.

Parameters
accountConnAccount to modify

Definition at line 332 of file mutt_account.c.

333 {
334  account->flags &= ~MUTT_ACCT_PASS;
335 }
#define MUTT_ACCT_PASS
Password field has been set.
Definition: mutt_account.h:63
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:39
+ Here is the caller graph for this function:

◆ mutt_account_getoauthbearer()

char* mutt_account_getoauthbearer ( struct ConnAccount account)

Get an OAUTHBEARER token.

Parameters
accountAccount to use
Return values
ptrOAuth token
NULLError

Run an external command to generate the oauth refresh token for an account, then create and encode the OAUTHBEARER token based on RFC7628.

Note
Caller should free the token

Definition at line 348 of file mutt_account.c.

349 {
350  FILE *fp = NULL;
351  char *cmd = NULL;
352  char *token = NULL;
353  size_t token_size = 0;
354  char *oauthbearer = NULL;
355  size_t oalen;
356  char *encoded_token = NULL;
357  size_t encoded_len;
358  pid_t pid;
359 
360  /* The oauthbearer token includes the login */
361  if (mutt_account_getlogin(account))
362  return NULL;
363 
364 #ifdef USE_IMAP
367 #endif
368 #ifdef USE_POP
369  else if ((account->type == MUTT_ACCT_TYPE_POP) && C_PopOauthRefreshCommand)
371 #endif
372 #ifdef USE_SMTP
373  else if ((account->type == MUTT_ACCT_TYPE_SMTP) && C_SmtpOauthRefreshCommand)
375 #endif
376 
377  if (!cmd)
378  {
379  /* L10N: You will see this error message if (1) you have "oauthbearer" in
380  one of your $*_authenticators and (2) you do not have the corresponding
381  $*_oauth_refresh_command defined. So the message does not mean "None of
382  your $*_oauth_refresh_command's are defined." */
383  mutt_error(_("No OAUTH refresh command defined"));
384  return NULL;
385  }
386 
387  pid = mutt_create_filter(cmd, NULL, &fp, NULL);
388  if (pid < 0)
389  {
390  mutt_perror(_("Unable to run refresh command"));
391  return NULL;
392  }
393 
394  token = mutt_file_read_line(NULL, &token_size, fp, NULL, 0);
395  mutt_file_fclose(&fp);
396  mutt_wait_filter(pid);
397 
398  if (!token || (*token == '\0'))
399  {
400  mutt_error(_("Command returned empty string"));
401  FREE(&token);
402  return NULL;
403  }
404 
405  /* Determine the length of the keyed message digest, add 50 for overhead. */
406  oalen = strlen(account->login) + strlen(account->host) + strlen(token) + 50;
407  oauthbearer = mutt_mem_malloc(oalen);
408 
409  snprintf(oauthbearer, oalen, "n,a=%s,\001host=%s\001port=%d\001auth=Bearer %s\001\001",
410  account->login, account->host, account->port, token);
411 
412  FREE(&token);
413 
414  encoded_len = strlen(oauthbearer) * 4 / 3 + 10;
415  encoded_token = mutt_mem_malloc(encoded_len);
416  mutt_b64_encode(oauthbearer, strlen(oauthbearer), encoded_token, encoded_len);
417  FREE(&oauthbearer);
418  return encoded_token;
419 }
pid_t mutt_create_filter(const char *s, FILE **fp_in, FILE **fp_out, FILE **fp_err)
Set up filter program.
Definition: filter.c:209
char login[128]
Definition: connaccount.h:34
#define mutt_perror(...)
Definition: logging.h:85
char * C_SmtpOauthRefreshCommand
Config: (smtp) External command to generate OAUTH refresh token.
Definition: mutt_account.c:52
#define _(a)
Definition: message.h:28
char * mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_num, int flags)
Read a line from a file.
Definition: file.c:664
char host[128]
Definition: connaccount.h:36
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:152
size_t mutt_b64_encode(const char *in, size_t inlen, char *out, size_t outlen)
Convert raw bytes to null-terminated base64 string.
Definition: base64.c:88
unsigned short port
Definition: connaccount.h:37
char * C_PopOauthRefreshCommand
Config: (pop) External command to generate OAUTH refresh token.
Definition: mutt_account.c:49
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
Definition: memory.c:90
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:38
char * C_ImapOauthRefreshCommand
Config: (imap) External command to generate OAUTH refresh token.
Definition: mutt_account.c:45
Imap Account.
Definition: mutt_account.h:52
Pop Account.
Definition: mutt_account.h:53
#define mutt_error(...)
Definition: logging.h:84
#define FREE(x)
Definition: memory.h:40
int mutt_account_getlogin(struct ConnAccount *account)
Retrieve login info into ConnAccount, if necessary.
Definition: mutt_account.c:250
Smtp Account.
Definition: mutt_account.h:54
int mutt_wait_filter(pid_t pid)
Wait for the exit of a process and return its status.
Definition: filter.c:220
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ C_ImapLogin

char* C_ImapLogin

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

Definition at line 44 of file mutt_account.c.

◆ C_ImapOauthRefreshCommand

char* C_ImapOauthRefreshCommand

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

Definition at line 45 of file mutt_account.c.

◆ C_ImapPass

char* C_ImapPass

Config: (imap) Password for the IMAP server.

Definition at line 46 of file mutt_account.c.

◆ C_NntpPass

char* C_NntpPass

Config: (nntp) Password for the news server.

Definition at line 47 of file mutt_account.c.

◆ C_NntpUser

char* C_NntpUser

Config: (nntp) Username for the news server.

Definition at line 48 of file mutt_account.c.

◆ C_PopOauthRefreshCommand

char* C_PopOauthRefreshCommand

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

Definition at line 49 of file mutt_account.c.

◆ C_PopPass

char* C_PopPass

Config: (pop) Password of the POP server.

Definition at line 50 of file mutt_account.c.

◆ C_PopUser

char* C_PopUser

Config: (pop) Username of the POP server.

Definition at line 51 of file mutt_account.c.

◆ C_SmtpOauthRefreshCommand

char* C_SmtpOauthRefreshCommand

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

Definition at line 52 of file mutt_account.c.

◆ C_SmtpPass

char* C_SmtpPass

Config: (smtp) Password for the SMTP server.

Definition at line 53 of file mutt_account.c.