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@10: * 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@10: typedef enum _pop3_error { meillo@10: pop3_ok = 0, meillo@10: pop3_fail, meillo@10: pop3_eof, meillo@10: pop3_timeout, meillo@10: pop3_login_failure, meillo@10: pop3_syntax meillo@0: } pop3_error; meillo@0: meillo@10: typedef struct pop3_base { meillo@10: FILE *in; meillo@10: FILE *out; meillo@10: gint sock; meillo@10: gint dup_sock; meillo@0: meillo@10: gchar *remote_host; meillo@10: gchar *buffer; meillo@0: meillo@10: gint next_id; meillo@10: gint msg_cnt; meillo@10: gint uidl_known_cnt; meillo@10: gint mbox_size; meillo@0: meillo@10: GList *list_uid_old; meillo@10: GList *drop_list; meillo@0: meillo@10: gchar *timestamp; meillo@0: meillo@10: guint flags; meillo@0: meillo@10: pop3_error error; meillo@0: } pop3_base; meillo@0: meillo@10: typedef struct _msg_info { meillo@10: gint number; meillo@10: gint size; meillo@10: gchar *uid; meillo@10: gboolean is_fetched; meillo@10: gboolean is_in_uidl; meillo@0: } msg_info; meillo@0: meillo@10: pop3_base *pop3_in_open(gchar * host, gint port, GList * resolve_list, guint flags); meillo@10: pop3_base *pop3_in_open_child(gchar * cmd, guint flags); meillo@10: void pop3_in_close(pop3_base * popb); meillo@10: 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); meillo@10: gboolean pop3_login(gchar * host, gint port, GList * resolve_list, gchar * user, gchar * pass, guint flags); meillo@0: meillo@0: meillo@0: meillo@0: #endif