Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / providers / pop3 / camel-pop3-provider.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-pop3-provider.c: pop3 provider registration code */
3
4 /* 
5  * Authors :
6  *   Dan Winship <danw@ximian.com>
7  *   Michael Zucchi <notzed@ximian.com>
8  *
9  * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
10  *
11  * This program is free software; you can redistribute it and/or 
12  * modify it under the terms of version 2 of the GNU Lesser General Public 
13  * License as published by the Free Software Foundation.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
23  * USA
24  */
25
26 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
29
30 #include <glib/gi18n-lib.h>
31
32 #include "camel-pop3-store.h"
33 #include "camel-provider.h"
34 #include "camel-sasl.h"
35 #include "camel-session.h"
36 #include "camel-url.h"
37
38
39 static CamelProviderConfEntry pop3_conf_entries[] = {
40         { CAMEL_PROVIDER_CONF_SECTION_START, "storage", NULL,
41           N_("Message storage") },
42         { CAMEL_PROVIDER_CONF_CHECKBOX, "keep_on_server", NULL,
43           N_("Leave messages on server"), "0" },
44         { CAMEL_PROVIDER_CONF_CHECKSPIN, "delete_after", NULL,
45           N_("Delete after %s day(s)"), "0:1:7:365" },
46         { CAMEL_PROVIDER_CONF_CHECKBOX, "disable_extensions", NULL,
47           N_("Disable support for all POP3 extensions"), "0" },
48         { CAMEL_PROVIDER_CONF_SECTION_END },
49         { CAMEL_PROVIDER_CONF_END }
50 };
51
52 static CamelProvider pop3_provider = {
53         "pop",
54         
55         N_("POP"),
56         
57         N_("For connecting to and downloading mail from POP servers."),
58         
59         "mail",
60         
61         CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
62         CAMEL_PROVIDER_SUPPORTS_SSL,
63         
64         CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
65         
66         pop3_conf_entries,
67         
68         /* ... */
69 };
70
71 CamelServiceAuthType camel_pop3_password_authtype = {
72         N_("Password"),
73
74         N_("This option will connect to the POP server using a plaintext "
75            "password. This is the only option supported by many POP servers."),
76
77         "",
78         TRUE
79 };
80
81 CamelServiceAuthType camel_pop3_apop_authtype = {
82         "APOP",
83
84         N_("This option will connect to the POP server using an encrypted "
85            "password via the APOP protocol. This may not work for all users "
86            "even on servers that claim to support it."),
87
88         "+APOP",
89         TRUE
90 };
91
92 void
93 camel_provider_module_init(void)
94 {
95         CamelServiceAuthType *auth;
96
97         pop3_provider.object_types[CAMEL_PROVIDER_STORE] = camel_pop3_store_get_type();
98         pop3_provider.url_hash = camel_url_hash;
99         pop3_provider.url_equal = camel_url_equal;
100
101         pop3_provider.authtypes = camel_sasl_authtype_list (FALSE);
102         auth = camel_sasl_authtype("LOGIN");
103         if (auth)
104                 pop3_provider.authtypes = g_list_prepend(pop3_provider.authtypes, auth);
105         pop3_provider.authtypes = g_list_prepend(pop3_provider.authtypes, &camel_pop3_apop_authtype);
106         pop3_provider.authtypes = g_list_prepend(pop3_provider.authtypes, &camel_pop3_password_authtype);
107         pop3_provider.translation_domain = GETTEXT_PACKAGE;
108
109         camel_provider_register(&pop3_provider);
110 }