meillo@0: /* pop3_in.h, Copyright 2000 (C) Oliver Kurth, meillo@0: * meillo@0: * This program is free software; you can redistribute it and/or modify meillo@0: * it under the terms of the GNU General Public License as published by meillo@0: * the Free Software Foundation; either version 2 of the License, or meillo@0: * (at your option) any later version. meillo@0: * meillo@0: * This program is distributed in the hope that it will be useful, meillo@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of meillo@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the meillo@0: * GNU General Public License for more details. meillo@0: * meillo@0: * You should have received a copy of the GNU General Public License meillo@0: * along with this program; if not, write to the Free Software meillo@0: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. meillo@0: */ meillo@0: meillo@0: #ifdef ENABLE_POP3 meillo@0: meillo@0: #define POP3_BUF_LEN 1024 meillo@0: meillo@0: #define POP3_INITIAL_TIMEOUT 5*60 meillo@0: #define POP3_CMD_TIMEOUT 5*60 meillo@0: #define POP3_DATA_TIMEOUT 5*60 meillo@0: #define POP3_FINAL_TIMEOUT 10*60 meillo@0: meillo@0: #define POP3_FLAG_DELETE 0x01 meillo@0: #define POP3_FLAG_UIDL 0x02 meillo@0: #define POP3_FLAG_UIDL_DELE 0x04 meillo@0: #define POP3_FLAG_APOP 0x08 meillo@0: meillo@0: #define POP3_MAX_CHILDREN 2 meillo@0: meillo@0: typedef meillo@0: enum _pop3_error{ meillo@0: pop3_ok = 0, meillo@0: pop3_fail, meillo@0: pop3_eof, meillo@0: pop3_timeout, meillo@0: pop3_login_failure, meillo@0: pop3_syntax meillo@0: } pop3_error; meillo@0: meillo@0: typedef struct pop3_base{ meillo@0: FILE *in; meillo@0: FILE *out; meillo@0: gint sock; meillo@0: gint dup_sock; meillo@0: meillo@0: gchar *remote_host; meillo@0: gchar *buffer; meillo@0: meillo@0: gint next_id; meillo@0: gint msg_cnt; meillo@0: gint uidl_known_cnt; meillo@0: gint mbox_size; meillo@0: meillo@0: GList *list_uid_old; meillo@0: GList *drop_list; meillo@0: meillo@0: gchar* timestamp; meillo@0: meillo@0: guint flags; meillo@0: meillo@0: pop3_error error; meillo@0: } pop3_base; meillo@0: meillo@0: typedef struct _msg_info{ meillo@0: gint number; meillo@0: gint size; meillo@0: gchar *uid; meillo@0: gboolean is_fetched; meillo@0: gboolean is_in_uidl; meillo@0: } msg_info; meillo@0: meillo@0: pop3_base *pop3_in_open(gchar *host, gint port, GList *resolve_list, guint flags); meillo@0: pop3_base *pop3_in_open_child(gchar *cmd, guint flags); meillo@0: void pop3_in_close(pop3_base *popb); meillo@0: gboolean pop3_get(pop3_base *popb, meillo@0: gchar *user, gchar *pass, address *rcpt, address *return_path, meillo@0: gint max_count, gint max_size, gboolean max_size_delete); meillo@0: gboolean pop3_login(gchar *host, gint port, GList *resolve_list, meillo@0: gchar *user, gchar *pass, guint flags); meillo@0: meillo@0: meillo@0: meillo@0: #endif