aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imapp/camel-imapp-provider.c
blob: 6b0cdd2d436419f208a2ed698fbc0147178d36d2 (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
87
88
89
90
91
92
93
94
95
96
97
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-pop3-provider.c: pop3 provider registration code */

/* 
 * Authors :
 *   Dan Winship <danw@ximian.com>
 *   Michael Zucchi <notzed@ximian.com>
 *
 * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
 *
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of version 2 of the GNU General Public 
 * License as published by the Free Software Foundation.
 *
 * 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
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "camel/camel-provider.h"
#include "camel/camel-session.h"
#include "camel/camel-url.h"
#include "camel/camel-sasl.h"

#include "camel-imapp-store.h"

CamelProviderConfEntry imapp_conf_entries[] = {
    { CAMEL_PROVIDER_CONF_SECTION_START, NULL, NULL,
      N_("Message storage") },
    { CAMEL_PROVIDER_CONF_SECTION_END },
    { CAMEL_PROVIDER_CONF_END }
};

static CamelProvider imapp_provider = {
    "imapp",
    
    N_("IMAP+"),
    
    N_("Experimental IMAP 4(.1) client\n"
       "This is untested and unsupported code, you want to use plain imap instead.\n\n"
       " !!! DO NOT USE THIS FOR PRODUCTION EMAIL  !!!\n"),
    "mail",
    
    CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
    CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL,
    
    CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
    
    imapp_conf_entries,
    
    /* ... */
};

CamelServiceAuthType camel_imapp_password_authtype = {
    N_("Password"),
    
    N_("This option will connect to the IMAP server using a "
       "plaintext password."),
    
    "",
    TRUE
};

void
camel_imapp_module_init(CamelSession *session)
{
    extern void camel_exception_setup(void);

    imapp_provider.object_types[CAMEL_PROVIDER_STORE] = camel_imapp_store_get_type();
    imapp_provider.url_hash = camel_url_hash;
    imapp_provider.url_equal = camel_url_equal;

    imapp_provider.authtypes = g_list_prepend(imapp_provider.authtypes, camel_sasl_authtype_list(FALSE));
    imapp_provider.authtypes = g_list_prepend(imapp_provider.authtypes, &camel_imapp_password_authtype);

    /* blah ... could just use it in object setup? */
    /* TEMPORARY */
    camel_exception_setup();

    camel_session_register_provider(session, &imapp_provider);
}

void
camel_provider_module_init(CamelSession *session)
{
    camel_imapp_module_init(session);
}