NeoMutt  2024-10-02-34-g9dd811
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
private.h
Go to the documentation of this file.
1
24#ifndef MUTT_POP_PRIVATE_H
25#define MUTT_POP_PRIVATE_H
26
27#include <stdbool.h>
28#include <time.h>
29#include "conn/lib.h"
30
31struct Mailbox;
32struct PopAccountData;
33struct Progress;
34
35#define POP_PORT 110
36#define POP_SSL_PORT 995
37
38/* number of entries in the hash table */
39#define POP_CACHE_LEN 10
40
41/* maximal length of the server response (RFC1939) */
42#define POP_CMD_RESPONSE 512
43
48{
52};
53
58{
63};
64
69{
70 unsigned int index;
71 char *path;
72};
73
77struct PopAuth
78{
87 enum PopAuthRes (*authenticate)(struct PopAccountData *adata, const char *method);
88
89 const char *method;
91};
92
93/* pop_auth.c */
94bool pop_auth_is_valid(const char *authenticator);
96void pop_apop_timestamp(struct PopAccountData *adata, char *buf);
97
108typedef int (*pop_fetch_t)(const char *str, void *data);
109
110/* pop_lib.c */
111#define pop_query(adata, buf, buflen) pop_query_d(adata, buf, buflen, NULL)
112int pop_parse_path(const char *path, struct ConnAccount *acct);
113int pop_connect(struct PopAccountData *adata);
115int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *msg);
116int pop_fetch_data(struct PopAccountData *adata, const char *query,
117 struct Progress *progress, pop_fetch_t callback, void *data);
118int pop_reconnect(struct Mailbox *m);
119void pop_logout(struct Mailbox *m);
120const char *pop_get_field(enum ConnAccountField field, void *gf_data);
121
122#endif /* MUTT_POP_PRIVATE_H */
Connection Library.
ConnAccountField
Login credentials.
Definition: connaccount.h:33
const char * pop_get_field(enum ConnAccountField field, void *gf_data)
Get connection login credentials - Implements ConnAccount::get_field() -.
Definition: lib.c:57
int pop_connect(struct PopAccountData *adata)
Open connection.
Definition: lib.c:282
PopAuthRes
POP authentication responses.
Definition: private.h:58
@ POP_A_UNAVAIL
No valid authentication method.
Definition: private.h:62
@ POP_A_SUCCESS
Authenticated successfully.
Definition: private.h:59
@ POP_A_FAILURE
Authentication failed.
Definition: private.h:61
@ POP_A_SOCKET
Connection lost.
Definition: private.h:60
int pop_open_connection(struct PopAccountData *adata)
Open connection and authenticate.
Definition: lib.c:317
bool pop_auth_is_valid(const char *authenticator)
Check if string is a valid pop authentication method.
Definition: auth.c:502
int(* pop_fetch_t)(const char *str, void *data)
Definition: private.h:108
int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *msg)
Send data from buffer and receive answer to the same buffer.
Definition: lib.c:466
int pop_parse_path(const char *path, struct ConnAccount *acct)
Parse a POP mailbox name.
Definition: lib.c:83
int pop_fetch_data(struct PopAccountData *adata, const char *query, struct Progress *progress, pop_fetch_t callback, void *data)
Read Headers with callback function.
Definition: lib.c:511
PopStatus
POP server responses.
Definition: private.h:48
@ POP_DISCONNECTED
Disconnected from server.
Definition: private.h:51
@ POP_CONNECTED
Connected to server.
Definition: private.h:50
@ POP_NONE
No connected to server.
Definition: private.h:49
void pop_apop_timestamp(struct PopAccountData *adata, char *buf)
Get the server timestamp for APOP authentication.
Definition: auth.c:301
int pop_authenticate(struct PopAccountData *adata)
Authenticate with a POP server.
Definition: auth.c:523
void pop_logout(struct Mailbox *m)
Logout from a POP server.
Definition: lib.c:425
int pop_reconnect(struct Mailbox *m)
Reconnect and verify indexes if connection was lost.
Definition: lib.c:609
void * adata
Private data (for Mailbox backends)
Definition: account.h:42
Login details for a remote server.
Definition: connaccount.h:53
A mailbox.
Definition: mailbox.h:79
POP-specific Account data -.
Definition: adata.h:37
POP authentication multiplexor.
Definition: private.h:78
const char * method
Name of authentication method supported, NULL means variable.
Definition: private.h:89
enum PopAuthRes(* authenticate)(struct PopAccountData *adata, const char *method)
Definition: private.h:87
POP-specific email cache.
Definition: private.h:69
unsigned int index
Definition: private.h:70
char * path
Definition: private.h:71