/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
*
* 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
#ifdef HAVE_CONFIG_H
# include "config.h"
+#include "claws-features.h"
#endif
#include <glib.h>
else
log_print(LOG_PROTOCOL, "POP3> %s\n", buf);
- session_send_msg(SESSION(session), SESSION_MSG_NORMAL, buf);
+ session_send_msg(SESSION(session), buf);
}
Session *pop3_session_new(PrefsAccount *account)
cm_return_val_if_fail(account != NULL, NULL);
+ account->receive_in_progress = TRUE;
+
session = g_new0(Pop3Session, 1);
session_init(SESSION(session), account, FALSE);
SESSION(session)->recv_msg = pop3_session_recv_msg;
SESSION(session)->recv_data_finished = pop3_session_recv_data_finished;
SESSION(session)->send_data_finished = NULL;
-
+ SESSION(session)->ssl_cert_auto_accept = account->ssl_certs_auto_accept;
SESSION(session)->destroy = pop3_session_destroy;
+#ifdef USE_GNUTLS
+ if (account->set_gnutls_priority && account->gnutls_priority &&
+ strlen(account->gnutls_priority) != 0)
+ SESSION(session)->gnutls_priority = g_strdup(account->gnutls_priority);
+#endif
+
session->state = POP3_READY;
session->ac_prefs = account;
session->pop_before_smtp = FALSE;
g_free(pop3_session->user);
g_free(pop3_session->pass);
g_free(pop3_session->error_msg);
+
+ pop3_session->ac_prefs->receive_in_progress = FALSE;
}
static void pop3_get_uidl_table(PrefsAccount *ac_prefs, Pop3Session *session)
#define TRY(func) \
if (!(func)) \
{ \
- g_warning("failed to write\n"); \
+ g_warning("failed to write"); \
goto err_write; \
} \
if ((cur > prev && fwrite(prev, 1, cur - prev, fp) < 1) ||
fputc('\n', fp) == EOF) {
FILE_OP_ERROR(file, "fwrite");
- g_warning("can't write to file: %s\n", file);
+ g_warning("can't write to file: %s", file);
fclose(fp);
claws_unlink(file);
return -1;
if (prev - data < len &&
fwrite(prev, 1, len - (prev - data), fp) < 1) {
FILE_OP_ERROR(file, "fwrite");
- g_warning("can't write to file: %s\n", file);
+ g_warning("can't write to file: %s", file);
fclose(fp);
claws_unlink(file);
return -1;
if (data[len - 1] != '\r' && data[len - 1] != '\n') {
if (fputc('\n', fp) == EOF) {
FILE_OP_ERROR(file, "fputc");
- g_warning("can't write to file: %s\n", file);
+ g_warning("can't write to file: %s", file);
fclose(fp);
claws_unlink(file);
return -1;