NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
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 
31 struct Mailbox;
32 struct PopAccountData;
33 struct 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 {
49  POP_NONE = 0,
52 };
53 
58 {
63 };
64 
68 struct PopCache
69 {
70  unsigned int index;
71  char *path;
72 };
73 
77 struct PopAuth
78 {
85  enum PopAuthRes (*authenticate)(struct PopAccountData *adata, const char *method);
86 
87  const char *method;
88 };
90 
91 /* pop_auth.c */
92 bool pop_auth_is_valid(const char *authenticator);
94 void pop_apop_timestamp(struct PopAccountData *adata, char *buf);
95 
103 typedef int (*pop_fetch_t)(const char *str, void *data);
104 
105 /* pop_lib.c */
106 #define pop_query(adata, buf, buflen) pop_query_d(adata, buf, buflen, NULL)
107 int pop_parse_path(const char *path, struct ConnAccount *acct);
108 int pop_connect(struct PopAccountData *adata);
110 int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *msg);
111 int pop_fetch_data(struct PopAccountData *adata, const char *query,
112  struct Progress *progress, pop_fetch_t callback, void *data);
113 int pop_reconnect(struct Mailbox *m);
114 void pop_logout(struct Mailbox *m);
115 const char *pop_get_field(enum ConnAccountField field, void *gf_data);
116 
117 #endif /* MUTT_POP_PRIVATE_H */
char * path
Definition: private.h:71
int pop_reconnect(struct Mailbox *m)
reconnect and verify indexes if connection was lost
Definition: lib.c:604
int(* pop_fetch_t)(const char *str, void *data)
Callback function to handle POP server responses.
Definition: private.h:103
int pop_open_connection(struct PopAccountData *adata)
Open connection and authenticate.
Definition: lib.c:310
int pop_connect(struct PopAccountData *adata)
Open connection.
Definition: lib.c:275
Connection lost.
Definition: private.h:60
PopStatus
POP server responses.
Definition: private.h:47
Authenticated successfully.
Definition: private.h:59
ConnAccountField
Login credentials.
Definition: connaccount.h:31
Disconnected from server.
Definition: private.h:51
A Progress Bar.
Definition: progress.c:47
Authentication failed.
Definition: private.h:61
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:461
No connected to server.
Definition: private.h:49
POP authentication multiplexor.
Definition: private.h:77
const char * method
Name of authentication method supported, NULL means variable.
Definition: private.h:87
void pop_logout(struct Mailbox *m)
logout from a POP server
Definition: lib.c:420
PopAuthRes
POP authentication responses.
Definition: private.h:57
A mailbox.
Definition: mailbox.h:81
int pop_parse_path(const char *path, struct ConnAccount *acct)
Parse a POP mailbox name.
Definition: lib.c:83
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
int pop_authenticate(struct PopAccountData *adata)
Authenticate with a POP server.
Definition: auth.c:428
Login details for a remote server.
Definition: connaccount.h:51
bool pop_auth_is_valid(const char *authenticator)
Check if string is a valid pop authentication method.
Definition: auth.c:407
Connected to server.
Definition: private.h:50
unsigned int index
Definition: private.h:70
Connection Library.
POP-specific email cache.
Definition: private.h:68
POP-specific Account data -.
Definition: adata.h:36
No valid authentication method.
Definition: private.h:62
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:506
void pop_apop_timestamp(struct PopAccountData *adata, char *buf)
Get the server timestamp for APOP authentication.
Definition: auth.c:207
const char * pop_get_field(enum ConnAccountField field, void *gf_data)
Get connection login credentials - Implements ConnAccount::get_field()
Definition: lib.c:57