#include "socket.h"
#include "hooks.h"
+static GHashTable *warned_expired = NULL;
+
static SSLCertificate *ssl_certificate_new_lookup(X509 *x509_cert, gchar *host, gushort port, gboolean lookup);
/* from Courier */
return TRUE;
}
} else if (asn1toTime(X509_get_notAfter(current_cert->x509_cert)) < time(NULL)) {
+ gchar *tmp = g_strdup_printf("%s:%d", current_cert->host, current_cert->port);
+
+ if (warned_expired == NULL)
+ warned_expired = g_hash_table_new(g_str_hash, g_str_equal);
+
+ if (g_hash_table_lookup(warned_expired, tmp)) {
+ g_free(tmp);
+ ssl_certificate_destroy(current_cert);
+ ssl_certificate_destroy(known_cert);
+ return TRUE;
+ }
+
cert_hook_data.cert = current_cert;
cert_hook_data.old_cert = NULL;
cert_hook_data.expired = TRUE;
hooks_invoke(SSLCERT_ASK_HOOKLIST, &cert_hook_data);
if (!cert_hook_data.accept) {
+ g_free(tmp);
ssl_certificate_destroy(current_cert);
ssl_certificate_destroy(known_cert);
return FALSE;
} else {
+ g_hash_table_insert(warned_expired, tmp, GINT_TO_POINTER(1));
ssl_certificate_destroy(current_cert);
ssl_certificate_destroy(known_cert);
return TRUE;
reply_account = account;
compose = compose_create(account, COMPOSE_REPLY, FALSE);
+
+ compose->updating = TRUE;
+
ifactory = gtk_item_factory_from_widget(compose->menubar);
menu_set_active(ifactory, "/Options/Remove references", FALSE);
menu_set_sensitive(ifactory, "/Options/Remove references", TRUE);
- compose->updating = TRUE;
compose->replyinfo = procmsg_msginfo_get_full_info(msginfo);
if (!compose->replyinfo)
compose->replyinfo = procmsg_msginfo_copy(msginfo);
- compose->updating = FALSE;
-
- if (compose->deferred_destroy) {
- compose_destroy(compose);
- return NULL;
- }
compose_extract_original_charset(compose);
compose->modified = FALSE;
compose_set_title(compose);
+
+ compose->updating = FALSE;
+
+ if (compose->deferred_destroy) {
+ compose_destroy(compose);
+ return NULL;
+ }
+
return compose;
}
compose->fwdinfo = procmsg_msginfo_get_full_info(msginfo);
if (!compose->fwdinfo)
compose->fwdinfo = procmsg_msginfo_copy(msginfo);
- compose->updating = FALSE;
-
- if (compose->deferred_destroy) {
- compose_destroy(compose);
- return NULL;
- }
compose_extract_original_charset(compose);
gchar *qmark;
MsgInfo *full_msginfo;
- compose->updating = TRUE;
full_msginfo = procmsg_msginfo_get_full_info(msginfo);
if (!full_msginfo)
full_msginfo = procmsg_msginfo_copy(msginfo);
- compose->updating = FALSE;
-
- if (compose->deferred_destroy) {
- compose_destroy(compose);
- return NULL;
- }
if (prefs_common.fw_quotemark &&
*prefs_common.fw_quotemark)
compose->modified = FALSE;
compose_set_title(compose);
+
+ compose->updating = FALSE;
+
+ if (compose->deferred_destroy) {
+ compose_destroy(compose);
+ return NULL;
+ }
+
return compose;
}
compose = compose_create(account, COMPOSE_FORWARD, FALSE);
+ compose->updating = TRUE;
+
textview = GTK_TEXT_VIEW(compose->text);
textbuf = gtk_text_view_get_buffer(textview);
compose_create_tags(textview, compose);
undo_block(compose->undostruct);
for (msginfo = msginfo_list; msginfo != NULL; msginfo = msginfo->next) {
- compose->updating = TRUE;
msgfile = procmsg_get_message_file_path((MsgInfo *)msginfo->data);
- compose->updating = FALSE;
- if (compose->deferred_destroy) {
- compose_destroy(compose);
- g_free(msgfile);
- return NULL;
- }
+
if (!is_file_exist(msgfile))
g_warning("%s: file not exist\n", msgfile);
else
undo_unblock(compose->undostruct);
compose->modified = FALSE;
compose_set_title(compose);
+
+ compose->updating = FALSE;
+
+ if (compose->deferred_destroy) {
+ compose_destroy(compose);
+ return NULL;
+ }
+
return compose;
}
g_return_if_fail(account != NULL);
compose = compose_create(account, COMPOSE_REEDIT, FALSE);
+
+ compose->updating = TRUE;
+
if (privacy_system != NULL) {
compose->privacy_system = privacy_system;
compose_use_signing(compose, use_signing);
activate_privacy_system(compose, account, FALSE);
}
- compose->updating = TRUE;
compose->targetinfo = procmsg_msginfo_copy(msginfo);
- compose->updating = FALSE;
-
- if (compose->deferred_destroy) {
- compose_destroy(compose);
- return;
- }
compose_extract_original_charset(compose);
}
if (compose_parse_header(compose, msginfo) < 0) {
+ compose->updating = FALSE;
+ compose_destroy(compose);
return;
}
compose_reedit_set_entry(compose, msginfo);
}
compose->modified = FALSE;
compose_set_title(compose);
+
+ compose->updating = FALSE;
+
+ if (compose->deferred_destroy) {
+ compose_destroy(compose);
+ }
}
Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
g_return_val_if_fail(account != NULL, NULL);
compose = compose_create(account, COMPOSE_REDIRECT, batch);
+
+ compose->updating = TRUE;
+
ifactory = gtk_item_factory_from_widget(compose->menubar);
compose_create_tags(GTK_TEXT_VIEW(compose->text), compose);
compose->replyinfo = NULL;
gtk_widget_grab_focus(compose->header_last->entry);
- compose->updating = TRUE;
filename = procmsg_get_message_file_path(msginfo);
- compose->updating = FALSE;
- if (compose->deferred_destroy) {
+ if (filename == NULL) {
+ compose->updating = FALSE;
compose_destroy(compose);
- g_free(filename);
- return NULL;
- }
- if (filename == NULL)
return NULL;
+ }
compose->redirect_filename = filename;
compose->modified = FALSE;
compose_set_title(compose);
- return compose;
+ compose->updating = FALSE;
+
+ if (compose->deferred_destroy) {
+ compose_destroy(compose);
+ return NULL;
+ }
+
+ return compose;
}
GList *compose_get_compose_list(void)
prefs_common.compose_x = x;
prefs_common.compose_y = y;
- if (compose->sending)
+ if (compose->sending || compose->updating)
return TRUE;
compose_close_cb(compose, 0, NULL);
return TRUE;
}
#define ETPAN_DEFAULT_NETWORK_TIMEOUT 60
+static gboolean etpan_skip_ssl_cert_check = FALSE;
-void imap_main_init(void)
+void imap_main_init(gboolean skip_ssl_cert_check)
{
int fd_thread_manager;
+ etpan_skip_ssl_cert_check = skip_ssl_cert_check;
mailstream_network_delay.tv_sec = ETPAN_DEFAULT_NETWORK_TIMEOUT;
mailstream_network_delay.tv_usec = 0;
threaded_run(folder, ¶m, &result, connect_ssl_run);
- if (result.error >= 0) {
+ if (result.error >= 0 && !etpan_skip_ssl_cert_check) {
cert_len = mailstream_ssl_get_certificate(imap->imap_stream, &certificate);
if (etpan_certificate_check(certificate, cert_len, ¶m) < 0)
return -1;
debug_print("imap starttls - end\n");
- if (result.error == 0) {
+ if (result.error == 0 && !etpan_skip_ssl_cert_check) {
cert_len = mailstream_ssl_get_certificate(param.imap->imap_stream, &certificate);
if (etpan_certificate_check(certificate, cert_len, ¶m) < 0)
result.error = MAILIMAP_ERROR_STREAM;