/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2015 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
#include "filtering.h"
#include "prefs_actions.h"
#include "hooks.h"
+#include "passwordstore.h"
enum {
ACCOUNT_IS_DEFAULT,
while (fgets(buf, sizeof(buf), fp) != NULL) {
if (!strncmp(buf, "[Account: ", 10)) {
strretchomp(buf);
- memmove(buf, buf + 1, strlen(buf) - 1);
+ memmove(buf, buf + 1, sizeof(buf) - 1);
buf[strlen(buf) - 1] = '\0';
debug_print("Found label: %s\n", buf);
ac_label_list = g_slist_append(ac_label_list,
void account_edit_focus(void)
{
+ if (edit_account.window == NULL) {
+ return;
+ }
manage_window_set_transient(GTK_WINDOW(edit_account.window));
gtk_widget_grab_focus(edit_account.close_btn);
gtk_widget_show(edit_account.window);
if (compose_get_compose_list()) {
alertpanel_error(_("Some composing windows are open.\n"
"Please close all the composing "
- "windows before editing the accounts."));
+ "windows before editing accounts."));
inc_unlock();
return;
}
cm_return_if_fail(ac_prefs != NULL);
+ if (compose_get_compose_list()) {
+ alertpanel_error(_("Some composing windows are open.\n"
+ "Please close all the composing "
+ "windows before editing accounts."));
+ return;
+ }
+
prev_default = ac_prefs->is_default;
Xstrdup_a(ac_name, ac_prefs->account_name ? ac_prefs->account_name : "",
return);
GINT_TO_POINTER(ac_prefs->account_id));
}
+ gchar *uid = g_strdup_printf("%d", ac_prefs->account_id);
+ passwd_store_delete_block(PWS_ACCOUNT, uid);
+ g_free(uid);
+
debug_print("Removing filter rules relative to this account...\n");
for(cur = filtering_rules ; cur != NULL ;) {
FilteringProp * prop = (FilteringProp *) cur->data;
#ifdef USE_GNUTLS
protocol = ac_prefs->protocol == A_POP3 ?
(ac_prefs->ssl_pop == SSL_TUNNEL ?
- "POP3 (SSL)" :
+ "POP (SSL/TLS)" :
ac_prefs->ssl_pop == SSL_STARTTLS ?
- "POP3 (TLS)" : "POP3") :
+ "POP (STARTTLS)" : "POP") :
ac_prefs->protocol == A_IMAP4 ?
(ac_prefs->ssl_imap == SSL_TUNNEL ?
- "IMAP4 (SSL)" :
+ "IMAP (SSL/TLS)" :
ac_prefs->ssl_imap == SSL_STARTTLS ?
- "IMAP4 (TLS)" : "IMAP4") :
+ "IMAP (STARTTLS)" : "IMAP") :
ac_prefs->protocol == A_NNTP ?
(ac_prefs->ssl_nntp == SSL_TUNNEL ?
- "NNTP (SSL)" : "NNTP") :
+ "NNTP (SSL/TLS)" : "NNTP") :
ac_prefs->protocol == A_LOCAL ? "Local" :
ac_prefs->protocol == A_NONE ? "SMTP" : "-";
#else
- protocol = ac_prefs->protocol == A_POP3 ? "POP3" :
- ac_prefs->protocol == A_IMAP4 ? "IMAP4" :
+ protocol = ac_prefs->protocol == A_POP3 ? "POP" :
+ ac_prefs->protocol == A_IMAP4 ? "IMAP" :
ac_prefs->protocol == A_LOCAL ? "Local" :
ac_prefs->protocol == A_NNTP ? "NNTP" :
ac_prefs->protocol == A_NONE ? "SMTP" : "-";
GtkTreeIter iter;
if (!gtk_tree_model_iter_nth_child(model, &iter, NULL, row)) {
- g_warning("%s(%d) - no iter found???\n", __FILE__, __LINE__);
+ g_warning("%s(%d) - no iter found???", __FILE__, __LINE__);
continue;
}
/* select the account set in folderitem's property (if enabled) */
if (msginfo->folder->prefs && msginfo->folder->prefs->enable_default_account)
account = account_find_from_id(msginfo->folder->prefs->default_account);
-
+ else if (folder_has_parent_of_type(msginfo->folder, F_QUEUE) ||
+ folder_has_parent_of_type(msginfo->folder, F_OUTBOX) ||
+ folder_has_parent_of_type(msginfo->folder, F_DRAFT)) {
+ gchar from[BUFFSIZE];
+ if (!procheader_get_header_from_msginfo
+ (msginfo, from, sizeof from, "From:")) {
+ gchar *buf = from + strlen("From:");
+ extract_address(buf);
+ account = account_find_from_address(buf, FALSE);
+ }
+ }
/* select account by to: and cc: header if enabled */
if (reply_autosel) {
gchar * field = NULL;
if (account->sig_type == SIG_FILE) {
if (!is_file_or_fifo_exist(account->sig_path)) {
- g_warning("can't open signature file: %s\n",
+ g_warning("can't open signature file: '%s'",
account->sig_path);
return NULL;
}