1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-pop3-provider.c: pop3 provider registration code */
6 * Dan Winship <danw@ximian.com>
7 * Michael Zucchi <notzed@ximian.com>
9 * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
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.
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.
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
30 #include <glib/gi18n-lib.h>
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"
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 }
52 static CamelProvider pop3_provider = {
57 N_("For connecting to and downloading mail from POP servers."),
61 CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
62 CAMEL_PROVIDER_SUPPORTS_SSL,
64 CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
71 CamelServiceAuthType camel_pop3_password_authtype = {
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."),
81 CamelServiceAuthType camel_pop3_apop_authtype = {
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."),
93 camel_provider_module_init(void)
95 CamelServiceAuthType *auth;
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;
101 pop3_provider.authtypes = camel_sasl_authtype_list (FALSE);
102 auth = camel_sasl_authtype("LOGIN");
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;
109 camel_provider_register(&pop3_provider);