2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2004 Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include "prefs_account.h"
33 typedef struct _Pop3MsgInfo Pop3MsgInfo;
34 typedef struct _Pop3Session Pop3Session;
36 #define POP3_SESSION(obj) ((Pop3Session *)obj)
38 #define MAIL_RECEIVE_HOOKLIST "mail_receive_hooklist"
39 struct _MailReceiveData
44 typedef struct _MailReceiveData MailReceiveData;
58 POP3_GETRANGE_UIDL_RECV,
60 POP3_GETSIZE_LIST_RECV,
73 PS_SUCCESS = 0, /* command successful */
74 PS_NOMAIL = 1, /* no mail available */
75 PS_SOCKET = 2, /* socket I/O woes */
76 PS_AUTHFAIL = 3, /* user authorization failed */
77 PS_PROTOCOL = 4, /* protocol violation */
78 PS_SYNTAX = 5, /* command-line syntax error */
79 PS_IOERR = 6, /* file I/O error */
80 PS_ERROR = 7, /* protocol error */
81 PS_EXCLUDE = 8, /* client-side exclusion error */
82 PS_LOCKBUSY = 9, /* server responded lock busy */
83 PS_SMTP = 10, /* SMTP error */
84 PS_DNS = 11, /* fatal DNS error */
85 PS_BSMTP = 12, /* output batch could not be opened */
86 PS_MAXFETCH = 13, /* poll ended by fetch limit */
88 PS_NOTSUPPORTED = 14, /* command not supported */
90 /* leave space for more codes */
92 PS_CONTINUE = 128 /* more responses may follow */
97 RECV_TIME_RECEIVED = 1,
108 guint partial_recv : 2;
118 PrefsAccount *ac_prefs;
119 gboolean pop_before_smtp;
128 gint cur_total_bytes;
129 gint cur_total_recv_bytes;
133 GHashTable *uidl_table;
134 GHashTable *partial_recv_table;
136 gboolean new_msg_exist;
137 gboolean uidl_is_valid;
141 Pop3ErrorValue error_val;
146 /* virtual method to drop message */
147 gint (*drop_message) (Pop3Session *session,
151 #define POPBUFSIZE 512
152 /* #define IDLEN 128 */
153 #define IDLEN POPBUFSIZE
155 Session *pop3_session_new (PrefsAccount *account);
156 void pop3_get_uidl_table (PrefsAccount *account, Pop3Session *session);
157 gint pop3_write_uidl_list (Pop3Session *session);
159 #endif /* __POP_H__ */