aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/pop3
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-12-01 07:43:39 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-12-01 07:43:39 +0800
commit0c3435a0e11086b8c9d39d87596ffe5ce7f5b133 (patch)
tree9d361c2e57913c76cfa7f9641726a7103c79e77f /camel/providers/pop3
parentad9d11c750290405cad22ba46b0f26ed3bb73155 (diff)
downloadgsoc2013-evolution-0c3435a0e11086b8c9d39d87596ffe5ce7f5b133.tar
gsoc2013-evolution-0c3435a0e11086b8c9d39d87596ffe5ce7f5b133.tar.gz
gsoc2013-evolution-0c3435a0e11086b8c9d39d87596ffe5ce7f5b133.tar.bz2
gsoc2013-evolution-0c3435a0e11086b8c9d39d87596ffe5ce7f5b133.tar.lz
gsoc2013-evolution-0c3435a0e11086b8c9d39d87596ffe5ce7f5b133.tar.xz
gsoc2013-evolution-0c3435a0e11086b8c9d39d87596ffe5ce7f5b133.tar.zst
gsoc2013-evolution-0c3435a0e11086b8c9d39d87596ffe5ce7f5b133.zip
Don't use regex matching. Fixes bug #16227.
2001-11-29 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-search.c (search_body_contains): Don't use regex matching. Fixes bug #16227. * camel-mime-message.c (best_encoding): Check the content-object's mime type, not the mime part types. Should fix bug #15843. 2001-11-27 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (get_content): Return NULL if construct_from_stream fails. (get_message): Same. (get_message_simple): Here too. (add_message_from_data): And here. svn path=/trunk/; revision=14834
Diffstat (limited to 'camel/providers/pop3')
-rw-r--r--camel/providers/pop3/camel-pop3-store.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index e959aa2de3..6ff88d61c2 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -348,7 +348,7 @@ pop3_try_authenticate (CamelService *service, const char *errmsg,
CamelPop3Store *store = (CamelPop3Store *)service;
int status;
char *msg;
-
+
/* The KPOP code will have set the password to be the username
* in connect_to_server. Password and APOP are the only other
* cases, and they both need a password. So if there's no
@@ -356,19 +356,18 @@ pop3_try_authenticate (CamelService *service, const char *errmsg,
*/
if (!service->url->passwd) {
char *prompt;
-
+
prompt = g_strdup_printf (_("%sPlease enter the POP3 password "
"for %s@%s"), errmsg ? errmsg : "",
service->url->user,
service->url->host);
- service->url->passwd = camel_session_get_password (
- camel_service_get_session (service),
- prompt, TRUE, service, "password", ex);
+ service->url->passwd = camel_session_get_password (camel_service_get_session (service),
+ prompt, TRUE, service, "password", ex);
g_free (prompt);
if (!service->url->passwd)
return FALSE;
}
-
+
if (!service->url->authmech || !strcmp (service->url->authmech, "+KPOP")) {
status = camel_pop3_command (store, &msg, ex, "USER %s",
service->url->user);
@@ -385,22 +384,22 @@ pop3_try_authenticate (CamelService *service, const char *errmsg,
return FALSE;
}
g_free (msg);
-
+
status = camel_pop3_command (store, &msg, ex, "PASS %s",
service->url->passwd);
} else if (!strcmp (service->url->authmech, "+APOP")
&& store->apop_timestamp) {
char *secret, md5asc[33], *d;
unsigned char md5sum[16], *s;
-
+
secret = g_strdup_printf ("%s%s", store->apop_timestamp,
service->url->passwd);
md5_get_digest (secret, strlen (secret), md5sum);
g_free (secret);
-
+
for (s = md5sum, d = md5asc; d < md5asc + 32; s++, d += 2)
sprintf (d, "%.2x", *s);
-
+
status = camel_pop3_command (store, &msg, ex, "APOP %s %s",
service->url->user, md5asc);
} else {
@@ -410,15 +409,16 @@ pop3_try_authenticate (CamelService *service, const char *errmsg,
"authentication mechanism."));
return FALSE;
}
-
+
if (status == CAMEL_POP3_ERR) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
_("Unable to connect to POP server.\n"
"Error sending password: %s"),
msg ? msg : _("(Unknown)"));
}
-
+
g_free (msg);
+
return status == CAMEL_POP3_ERR;
}
@@ -427,36 +427,33 @@ pop3_connect (CamelService *service, CamelException *ex)
{
char *errbuf = NULL;
gboolean tryagain;
-
+
if (!connect_to_server (service, ex))
return FALSE;
-
+
camel_exception_clear (ex);
do {
if (camel_exception_is_set (ex)) {
- errbuf = g_strdup_printf (
- "%s\n\n",
- camel_exception_get_description (ex));
+ errbuf = g_strdup_printf ("%s\n\n", camel_exception_get_description (ex));
camel_exception_clear (ex);
-
+
/* Uncache the password before prompting again. */
- camel_session_forget_password (
- camel_service_get_session (service),
- service, "password", ex);
+ camel_session_forget_password (camel_service_get_session (service),
+ service, "password", ex);
g_free (service->url->passwd);
service->url->passwd = NULL;
}
-
+
tryagain = pop3_try_authenticate (service, errbuf, ex);
g_free (errbuf);
errbuf = NULL;
} while (tryagain);
-
+
if (camel_exception_is_set (ex)) {
camel_service_disconnect (service, TRUE, ex);
return FALSE;
}
-
+
return TRUE;
}