2 * Copyright (C) 2000-2003 Vsevolod Volkov <vvv@mutt.org.ua>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #include "mutt_socket.h"
24 #include "mutt_curses.h"
28 #define POP_SSL_PORT 995
30 /* number of entries in the hash table */
31 #define POP_CACHE_LEN 10
33 /* maximal length of the server response (RFC1939) */
34 #define POP_CMD_RESPONSE 512
62 unsigned int status : 2;
63 unsigned int capabilities : 1;
64 unsigned int use_stls : 2;
65 unsigned int cmd_capa : 1; /* optional command CAPA */
66 unsigned int cmd_stls : 1; /* optional command STLS */
67 unsigned int cmd_user : 2; /* optional command USER */
68 unsigned int cmd_uidl : 2; /* optional command UIDL */
69 unsigned int cmd_top : 2; /* optional command TOP */
70 unsigned int resp_codes : 1; /* server supports extended response codes */
71 unsigned int expire : 1; /* expire is greater than 0 */
72 unsigned int clear_cache : 1;
75 time_t login_delay; /* minimal login delay capability */
76 char *auth_list; /* list of auth mechanisms */
78 body_cache_t *bcache; /* body cache */
79 char err_msg[POP_CMD_RESPONSE];
80 POP_CACHE cache[POP_CACHE_LEN];
85 /* do authentication, using named method or any available if method is NULL */
86 pop_auth_res_t (*authenticate) (POP_DATA *, const char *);
87 /* name of authentication method supported, NULL means variable. If this
88 * is not null, authenticate may ignore the second parameter. */
93 int pop_authenticate (POP_DATA *);
94 void pop_apop_timestamp (POP_DATA *, char *);
97 #define pop_query(A,B,C) pop_query_d(A,B,C,NULL)
98 int pop_parse_path (const char *, ACCOUNT *);
99 int pop_connect (POP_DATA *);
100 int pop_open_connection (POP_DATA *);
101 int pop_query_d (POP_DATA *, char *, size_t, char *);
102 int pop_fetch_data (POP_DATA *, char *, progress_t *, int (*funct) (char *, void *), void *);
103 int pop_reconnect (CONTEXT *);
104 void pop_logout (CONTEXT *);
105 void pop_error (POP_DATA *, char *);
108 int pop_check_mailbox (CONTEXT *, int *);
109 int pop_open_mailbox (CONTEXT *);
110 int pop_sync_mailbox (CONTEXT *, int *);
111 int pop_fetch_message (MESSAGE *, CONTEXT *, int);
112 int pop_close_mailbox (CONTEXT *);
113 void pop_fetch_mail (void);