NeoMutt  2025-12-11-276-g10b23b
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
auth.h File Reference

IMAP authenticator multiplexor. More...

#include <stdbool.h>
+ Include dependency graph for auth.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  ImapAuthRes { IMAP_AUTH_SUCCESS = 0 , IMAP_AUTH_FAILURE , IMAP_AUTH_UNAVAIL }
 Results of IMAP Authentication. More...
 

Functions

bool imap_auth_is_valid (const char *authenticator)
 Check if string is a valid imap authentication method.
 
enum ImapAuthRes imap_auth_plain (struct ImapAccountData *adata, const char *method)
 SASL PLAIN support - Implements ImapAuth::authenticate() -.
 
enum ImapAuthRes imap_auth_anon (struct ImapAccountData *adata, const char *method)
 Authenticate anonymously - Implements ImapAuth::authenticate() -.
 
enum ImapAuthRes imap_auth_cram_md5 (struct ImapAccountData *adata, const char *method)
 Authenticate using CRAM-MD5 - Implements ImapAuth::authenticate() -.
 
enum ImapAuthRes imap_auth_login (struct ImapAccountData *adata, const char *method)
 Plain LOGIN support - Implements ImapAuth::authenticate() -.
 
enum ImapAuthRes imap_auth_gss (struct ImapAccountData *adata, const char *method)
 GSS Authentication support - Implements ImapAuth::authenticate() -.
 
enum ImapAuthRes imap_auth_oauth (struct ImapAccountData *adata, const char *method)
 Authenticate an IMAP connection using OAUTHBEARER - Implements ImapAuth::authenticate() -.
 
enum ImapAuthRes imap_auth_xoauth2 (struct ImapAccountData *adata, const char *method)
 Authenticate an IMAP connection using XOAUTH2 - Implements ImapAuth::authenticate() -.
 

Detailed Description

IMAP authenticator multiplexor.

Authors
  • Brendan Cully
  • 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 auth.h.

Enumeration Type Documentation

◆ ImapAuthRes

Results of IMAP Authentication.

Enumerator
IMAP_AUTH_SUCCESS 

Authentication successful.

IMAP_AUTH_FAILURE 

Authentication failed.

IMAP_AUTH_UNAVAIL 

Authentication method not permitted.

Definition at line 37 of file auth.h.

38{
42};
@ IMAP_AUTH_FAILURE
Authentication failed.
Definition auth.h:40
@ IMAP_AUTH_SUCCESS
Authentication successful.
Definition auth.h:39
@ IMAP_AUTH_UNAVAIL
Authentication method not permitted.
Definition auth.h:41

Function Documentation

◆ imap_auth_is_valid()

bool imap_auth_is_valid ( const char * authenticator)

Check if string is a valid imap authentication method.

Parameters
authenticatorAuthenticator string to check
Return values
trueArgument is a valid auth method

Validate whether an input string is an accepted imap authentication method as defined by ImapAuthenticators.

Definition at line 96 of file auth.c.

97{
98 for (size_t i = 0; i < countof(ImapAuthenticators); i++)
99 {
100 const struct ImapAuth *auth = &ImapAuthenticators[i];
101 if (auth->method && mutt_istr_equal(auth->method, authenticator))
102 return true;
103 }
104
105 return false;
106}
static const struct ImapAuth ImapAuthenticators[]
Accepted authentication methods.
Definition auth.c:65
#define countof(x)
Definition memory.h:49
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:674
IMAP authentication multiplexor.
Definition auth.c:47
const char * method
Name of authentication method supported, NULL means variable.
Definition auth.c:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function: