NeoMutt  2022-04-29-178-g3b62e6
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
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{
85 enum PopAuthRes (*authenticate)(struct PopAccountData *adata, const char *method);
86
87 const char *method;
89};
90
91/* pop_auth.c */
92bool pop_auth_is_valid(const char *authenticator);
94void pop_apop_timestamp(struct PopAccountData *adata, char *buf);
95
106typedef int (*pop_fetch_t)(const char *str, void *data);
107
108/* pop_lib.c */
109#define pop_query(adata, buf, buflen) pop_query_d(adata, buf, buflen, NULL)
110int pop_parse_path(const char *path, struct ConnAccount *acct);
111int pop_connect(struct PopAccountData *adata);
113int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *msg);
114int pop_fetch_data(struct PopAccountData *adata, const char *query,
115 struct Progress *progress, pop_fetch_t callback, void *data);
116int pop_reconnect(struct Mailbox *m);
117void pop_logout(struct Mailbox *m);
118const char *pop_get_field(enum ConnAccountField field, void *gf_data);
119
120#endif /* MUTT_POP_PRIVATE_H */
Connection Library.
ConnAccountField
Login credentials.
Definition: connaccount.h:33
int pop_connect(struct PopAccountData *adata)
Open connection.
Definition: lib.c:273
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
const char * pop_get_field(enum ConnAccountField field, void *gf_data)
Get connection login credentials - Implements ConnAccount::get_field()
Definition: lib.c:56
int pop_open_connection(struct PopAccountData *adata)
Open connection and authenticate.
Definition: lib.c:308
bool pop_auth_is_valid(const char *authenticator)
Check if string is a valid pop authentication method.
Definition: auth.c:403
int(* pop_fetch_t)(const char *str, void *data)
Definition: private.h:106
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:457
int pop_parse_path(const char *path, struct ConnAccount *acct)
Parse a POP mailbox name.
Definition: lib.c:82
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:502
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:204
int pop_authenticate(struct PopAccountData *adata)
Authenticate with a POP server.
Definition: auth.c:424
void pop_logout(struct Mailbox *m)
Logout from a POP server.
Definition: lib.c:416
int pop_reconnect(struct Mailbox *m)
Reconnect and verify indexes if connection was lost.
Definition: lib.c:599
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
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:87
enum PopAuthRes(* authenticate)(struct PopAccountData *adata, const char *method)
Authenticate a POP connection.
Definition: private.h:85
POP-specific email cache.
Definition: private.h:69
unsigned int index
Definition: private.h:70
char * path
Definition: private.h:71