aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/imap.h
blob: 3884651c427a5be013f4bce41ac2150449d727ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*  Spruce
 *  Copyright (C) 1999-2000 Jeffrey Stedfast
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef __IMAP_H__
#define __IMAP_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <gtk/gtk.h>
#undef MIN
#undef MAX
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "parse.h"
#include "server.h"
#include "mime.h"
#include "cram-md5.h"

struct imap_account
{
    Server server;
    gchar *username;
    gchar *password;
    gint socket;
};

gint imap_ok (gint tag, gchar *line);

gint imap_login_cram_md5(gint socket, gchar *username, gchar *password);

gint imap_login (gint socket, gchar *username, gchar *password);

GList *imap_list (gint socket, gchar *namespace);

gint imap_select_mailbox (gint socket, gchar *mailbox, gchar *namespace);

gint imap_logout (gint socket);

gint imap_mailbox_create (gint socket, gchar *mailbox);

gint imap_mailbox_delete (gint socket, gchar *mailbox);

gchar *imap_fetch (gint socket, gint mesgnum, gchar *part, gint *seen);

gboolean imap_delete (const ImapAccount_t *imap, GList *sorted);

gint imap_connect(Server *server);

gint imap_add_part(gchar *c);

gint imap_parts (gint socket, gint mesg_num);

gint imap_get_string (gchar *index, gchar *dest, gint destlen, gchar *def);

gint imap_get_number (gchar *index, gint *dest);

gint imap_skip_section(gchar *index);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif