2 * Copyright notice from original mutt:
3 * Copyright (C) 2000-2003 Vsevolod Volkov <vvv@mutt.org.ua>
5 * This file is part of mutt-ng, see http://www.muttng.org/.
6 * It's licensed under the GNU General Public License,
7 * please see the file GPL in the top level source directory.
13 #include <lib-ui/curses.h>
14 #include <lib-sys/mutt_socket.h>
15 #include <lib-mx/mx.h>
18 extern mx_t const pop_mx;
22 #define POP_SSL_PORT 995
24 /* number of entries in the hash table */
25 #define POP_CACHE_LEN 10
27 /* maximal length of the server response (RFC1939) */
28 #define POP_CMD_RESPONSE 512
50 typedef enum pop_query_status_e {
51 PFD_FUNCT_ERROR = -3, /* pop_fetch_data uses pop_query_status and this return value */
53 PQ_NOT_CONNECTED = -1,
57 typedef enum cmd_status_e {
58 CMD_NOT_AVAILABLE = 0,
60 CMD_UNKNOWN /* unknown whether it is available or not */
65 unsigned int status:2;
66 unsigned int capabilities:1;
67 unsigned int use_stls:2;
68 cmd_status cmd_capa; /* optional command CAPA */
69 cmd_status cmd_stls; /* optional command STLS */
70 cmd_status cmd_user; /* optional command USER */
71 cmd_status cmd_uidl; /* optional command UIDL */
72 cmd_status cmd_top; /* optional command TOP */
73 unsigned int resp_codes:1; /* server supports extended response codes */
74 unsigned int expire:1; /* expire is greater than 0 */
75 unsigned int clear_cache:1;
78 time_t login_delay; /* minimal login delay capability */
79 char *auth_list; /* list of auth mechanisms */
81 char err_msg[POP_CMD_RESPONSE];
82 POP_CACHE cache[POP_CACHE_LEN];
86 /* do authentication, using named method or any available if method is NULL */
87 pop_auth_res_t (*authenticate) (POP_DATA *, const char *);
88 /* name of authentication method supported, NULL means variable. If this
89 * is not null, authenticate may ignore the second parameter. */
94 int pop_authenticate (POP_DATA *);
95 void pop_apop_timestamp (POP_DATA *, char *);
98 int pop_parse_path (const char *, ACCOUNT *);
99 int pop_connect (POP_DATA *);
100 pop_query_status pop_open_connection (POP_DATA *);
101 pop_query_status pop_query (POP_DATA *, char *, size_t);
102 pop_query_status pop_fetch_data (POP_DATA *, const char *, progress_t*,
103 int (*funct) (char *, void *), void *);
104 pop_query_status pop_reconnect (CONTEXT *);
105 void pop_logout (CONTEXT *);
106 void pop_error (POP_DATA *, char *);
109 int pop_fetch_message (MESSAGE *, CONTEXT *, int);
110 void pop_fetch_mail (void);