NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
private.h
Go to the documentation of this file.
1
23
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#define POP_CACHE_LEN 10
39
40#define POP_CMD_RESPONSE 512
41
51
62
67{
68 unsigned int index;
69 char *path;
70};
71
75struct PopAuth
76{
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
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_connect(struct PopAccountData *adata)
Open connection.
Definition lib.c:281
PopAuthRes
POP authentication responses.
Definition private.h:56
@ POP_A_UNAVAIL
No valid authentication method.
Definition private.h:60
@ POP_A_SUCCESS
Authenticated successfully.
Definition private.h:57
@ POP_A_FAILURE
Authentication failed.
Definition private.h:59
@ POP_A_SOCKET
Connection lost.
Definition private.h:58
int pop_open_connection(struct PopAccountData *adata)
Open connection and authenticate.
Definition lib.c:316
bool pop_auth_is_valid(const char *authenticator)
Check if string is a valid pop authentication method.
Definition auth.c:503
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:466
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:511
PopStatus
POP server responses.
Definition private.h:46
@ POP_DISCONNECTED
Disconnected from server.
Definition private.h:49
@ POP_CONNECTED
Connected to server.
Definition private.h:48
@ POP_NONE
No connected to server.
Definition private.h:47
void pop_apop_timestamp(struct PopAccountData *adata, char *buf)
Get the server timestamp for APOP authentication.
Definition auth.c:302
int pop_authenticate(struct PopAccountData *adata)
Authenticate with a POP server.
Definition auth.c:524
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:78
POP-specific Account data -.
Definition adata.h:37
POP authentication multiplexor.
Definition private.h:76
const char * method
Name of authentication method supported, NULL means variable.
Definition private.h:87
enum PopAuthRes(* authenticate)(struct PopAccountData *adata, const char *method)
Definition private.h:85
POP-specific email cache.
Definition private.h:67
unsigned int index
Message index.
Definition private.h:68
char * path
Filesystem path.
Definition private.h:69