ACP_FASSIGN(ssl_smtp);
ACP_FASSIGN(use_nonblocking_ssl);
- ac_clon->tmp_pass = NULL;
-
/* receive */
ACP_FASSIGN(use_apop_auth);
ACP_FASSIGN(rmmail);
ACP_FDUP(smtp_userid);
ACP_FDUP(smtp_passwd);
- ac_clon->tmp_smtp_pass = NULL;
-
ACP_FASSIGN(pop_before_smtp);
ACP_FASSIGN(pop_before_smtp_timeout);
ACP_FASSIGN(last_pop_login_time);
{
account_list_set();
}
+
+gchar *account_get_signature_str(PrefsAccount *account)
+{
+ gchar *sig_body = NULL;
+ gchar *sig_str = NULL;
+ gchar *utf8_sig_str = NULL;
+
+ g_return_val_if_fail(account != NULL, NULL);
+
+ if (!account->sig_path)
+ return NULL;
+printf("opening %s\n", account->sig_path);
+
+ if (account->sig_type == SIG_FILE) {
+ if (!is_file_or_fifo_exist(account->sig_path)) {
+ g_warning("can't open signature file: %s\n",
+ account->sig_path);
+ return NULL;
+ }
+ }
+
+ if (account->sig_type == SIG_COMMAND)
+ sig_body = get_command_output(account->sig_path);
+ else {
+ gchar *tmp;
+
+ tmp = file_read_to_str(account->sig_path);
+ if (!tmp)
+ return NULL;
+ sig_body = normalize_newlines(tmp);
+ g_free(tmp);
+ }
+
+ if (account->sig_sep) {
+ sig_str = g_strconcat("\n", account->sig_sep, "\n", sig_body,
+ NULL);
+ g_free(sig_body);
+ } else
+ sig_str = g_strconcat("\n", sig_body, NULL);
+
+ if (sig_str) {
+ if (g_utf8_validate(sig_str, -1, NULL) == TRUE)
+ utf8_sig_str = sig_str;
+ else {
+ utf8_sig_str = conv_codeset_strdup
+ (sig_str, conv_get_locale_charset_str_no_utf8(),
+ CS_INTERNAL);
+ g_free(sig_str);
+ }
+ }
+
+ return utf8_sig_str;
+}