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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 #include "mutt_socket.h"
26 #define POP_SSL_PORT 995
28 /* number of entries in the hash table */
29 #define POP_CACHE_LEN 10
31 /* maximal length of the server response (RFC1939) */
32 #define POP_CMD_RESPONSE 512
60 unsigned int status : 2;
61 unsigned int capabilities : 1;
62 unsigned int use_stls : 2;
63 unsigned int cmd_capa : 1; /* optional command CAPA */
64 unsigned int cmd_stls : 1; /* optional command STLS */
65 unsigned int cmd_user : 2; /* optional command USER */
66 unsigned int cmd_uidl : 2; /* optional command UIDL */
67 unsigned int cmd_top : 2; /* optional command TOP */
68 unsigned int resp_codes : 1; /* server supports extended response codes */
69 unsigned int expire : 1; /* expire is greater than 0 */
70 unsigned int clear_cache : 1;
73 time_t login_delay; /* minimal login delay capability */
74 char *auth_list; /* list of auth mechanisms */
76 char err_msg[POP_CMD_RESPONSE];
77 POP_CACHE cache[POP_CACHE_LEN];
82 /* do authentication, using named method or any available if method is NULL */
83 pop_auth_res_t (*authenticate) (POP_DATA *, const char *);
84 /* name of authentication method supported, NULL means variable. If this
85 * is not null, authenticate may ignore the second parameter. */
90 int pop_authenticate (POP_DATA *);
91 void pop_apop_timestamp (POP_DATA *, char *);
94 #define pop_query(A,B,C) pop_query_d(A,B,C,NULL)
95 int pop_parse_path (const char *, ACCOUNT *);
96 int pop_connect (POP_DATA *);
97 int pop_open_connection (POP_DATA *);
98 int pop_query_d (POP_DATA *, char *, size_t, char *);
99 int pop_fetch_data (POP_DATA *, char *, char *, int (*funct) (char *, void *), void *);
100 int pop_reconnect (CONTEXT *);
101 void pop_logout (CONTEXT *);
102 void pop_error (POP_DATA *, char *);
105 int pop_check_mailbox (CONTEXT *, int *);
106 int pop_open_mailbox (CONTEXT *);
107 int pop_sync_mailbox (CONTEXT *, int *);
108 int pop_fetch_message (MESSAGE *, CONTEXT *, int);
109 void pop_close_mailbox (CONTEXT *);
110 void pop_fetch_mail (void);