2 * Copyright (C) 2011 - Roberto Branciforti
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include <polarssl/ssl.h>
24 #include <polarssl/havege.h>
26 #define POP3_BUFSIZE 1000
29 int sockfd
; /* Socket descriptor */
30 char *name
; /* Hostname */
31 char *port
; /* Port */
34 #define POP3_AUTH_USERPASS 0
35 #define POP3_AUTH_SSL 1
37 struct pop3_auth_ssl
{
45 unsigned int type
; /* Authentication type */
47 char *user
; /* User name */
48 char *pass
; /* Password */
50 struct pop3_auth_ssl ssl
;
54 struct pop3_host host
;
55 struct pop3_auth auth
;
56 unsigned int messages
; /* Number of messages in maildrop */
60 int pop3_connect(struct pop3_mailbox
*mbox
);
61 int pop3_disconnect(struct pop3_mailbox
*mbox
);
64 int pop3_authenticate(struct pop3_mailbox
*mbox
);
66 /* Maildrop commands */
67 int pop3_stat(struct pop3_mailbox
*mbox
);
68 int pop3_list(struct pop3_mailbox
*mbox
);
69 int pop3_capa(struct pop3_mailbox
*mbox
);
71 int pop3_top(struct pop3_mailbox
*mbox
, unsigned int n
);
72 int pop3_retr(struct pop3_mailbox
*mbox
, unsigned int n
);