masqmail
view src/pop3_in.h @ 0:08114f7dcc23
this is masqmail-0.2.21 from oliver kurth
author | meillo@marmaro.de |
---|---|
date | Fri, 26 Sep 2008 17:05:23 +0200 |
parents | |
children | 26e34ae9a3e3 |
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
35 enum _pop3_error{
36 pop3_ok = 0,
37 pop3_fail,
38 pop3_eof,
39 pop3_timeout,
40 pop3_login_failure,
41 pop3_syntax
42 } pop3_error;
44 typedef struct pop3_base{
45 FILE *in;
46 FILE *out;
47 gint sock;
48 gint dup_sock;
50 gchar *remote_host;
51 gchar *buffer;
53 gint next_id;
54 gint msg_cnt;
55 gint uidl_known_cnt;
56 gint mbox_size;
58 GList *list_uid_old;
59 GList *drop_list;
61 gchar* timestamp;
63 guint flags;
65 pop3_error error;
66 } pop3_base;
68 typedef struct _msg_info{
69 gint number;
70 gint size;
71 gchar *uid;
72 gboolean is_fetched;
73 gboolean is_in_uidl;
74 } msg_info;
76 pop3_base *pop3_in_open(gchar *host, gint port, GList *resolve_list, guint flags);
77 pop3_base *pop3_in_open_child(gchar *cmd, guint flags);
78 void pop3_in_close(pop3_base *popb);
79 gboolean pop3_get(pop3_base *popb,
80 gchar *user, gchar *pass, address *rcpt, address *return_path,
81 gint max_count, gint max_size, gboolean max_size_delete);
82 gboolean pop3_login(gchar *host, gint port, GList *resolve_list,
83 gchar *user, gchar *pass, guint flags);
87 #endif