masqmail-0.2
view src/pop3_in.h @ 23:4a3bc3a7afbe
refactoring: early exit instead of deep if levels
author | meillo@marmaro.de |
---|---|
date | Fri, 05 Dec 2008 11:32:26 +0100 |
parents | 08114f7dcc23 |
children |
line source
1 /* pop3_in.h, Copyright 2000 (C) Oliver Kurth,
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 */
18 #ifdef ENABLE_POP3
20 #define POP3_BUF_LEN 1024
22 #define POP3_INITIAL_TIMEOUT 5*60
23 #define POP3_CMD_TIMEOUT 5*60
24 #define POP3_DATA_TIMEOUT 5*60
25 #define POP3_FINAL_TIMEOUT 10*60
27 #define POP3_FLAG_DELETE 0x01
28 #define POP3_FLAG_UIDL 0x02
29 #define POP3_FLAG_UIDL_DELE 0x04
30 #define POP3_FLAG_APOP 0x08
32 #define POP3_MAX_CHILDREN 2
34 typedef enum _pop3_error {
35 pop3_ok = 0,
36 pop3_fail,
37 pop3_eof,
38 pop3_timeout,
39 pop3_login_failure,
40 pop3_syntax
41 } pop3_error;
43 typedef struct pop3_base {
44 FILE *in;
45 FILE *out;
46 gint sock;
47 gint dup_sock;
49 gchar *remote_host;
50 gchar *buffer;
52 gint next_id;
53 gint msg_cnt;
54 gint uidl_known_cnt;
55 gint mbox_size;
57 GList *list_uid_old;
58 GList *drop_list;
60 gchar *timestamp;
62 guint flags;
64 pop3_error error;
65 } pop3_base;
67 typedef struct _msg_info {
68 gint number;
69 gint size;
70 gchar *uid;
71 gboolean is_fetched;
72 gboolean is_in_uidl;
73 } msg_info;
75 pop3_base *pop3_in_open(gchar * host, gint port, GList * resolve_list, guint flags);
76 pop3_base *pop3_in_open_child(gchar * cmd, guint flags);
77 void pop3_in_close(pop3_base * popb);
78 gboolean pop3_get(pop3_base * popb, gchar * user, gchar * pass, address * rcpt, address * return_path, gint max_count, gint max_size, gboolean max_size_delete);
79 gboolean pop3_login(gchar * host, gint port, GList * resolve_list, gchar * user, gchar * pass, guint flags);
83 #endif