MsgInfo *msginfo;
MsgFlags flags = {0, 0};
- if (procmime_get_encoding_for_file(file) == ENC_7BIT)
+ if (procmime_get_encoding_for_text_file(file) == ENC_7BIT)
ainfo->encoding = ENC_7BIT;
else
ainfo->encoding = ENC_8BIT;
procmsg_msginfo_free(msginfo);
} else {
if (!g_ascii_strncasecmp(content_type, "text", 4))
- ainfo->encoding =
- procmime_get_encoding_for_file(file);
+ ainfo->encoding = procmime_get_encoding_for_text_file(file);
else
ainfo->encoding = ENC_BASE64;
name = g_path_get_basename(filename ? filename : file);
g_strdup("application/octet-stream");
ainfo->encoding = ENC_BASE64;
} else if (!g_ascii_strncasecmp(ainfo->content_type, "text", 4))
- ainfo->encoding = procmime_get_encoding_for_file(file);
+ ainfo->encoding =
+ procmime_get_encoding_for_text_file(file);
else
ainfo->encoding = ENC_BASE64;
name = g_path_get_basename(filename ? filename : file);
folder_item_scan(folder);
if (prefs_common.send_dialog_mode == SEND_DIALOG_ALWAYS)
gtk_widget_destroy(compose->window);
- }
+ } else {
+ alertpanel_error(_("The message was queued but could not be "
+ "sent.\nUse \"Send queued messages\" from "
+ "the main window to retry."));
+ if (prefs_common.send_dialog_mode == SEND_DIALOG_ALWAYS) {
+ compose_allow_user_actions (compose, TRUE);
+ compose->sending = FALSE;
+ }
+ return -1;
+ }
return 0;
/* Resent-Message-ID */
if (compose->account->gen_msgid) {
- generate_msgid(compose->account->address, buf, sizeof(buf));
+ generate_msgid(buf, sizeof(buf));
fprintf(fp, "Resent-Message-ID: <%s>\n", buf);
compose->msgid = g_strdup(buf);
}
gchar *encdata;
encdata = privacy_get_encrypt_data(compose->privacy_system, compose->to_list);
- fprintf(fp, "X-Sylpheed-Encrypt-Data:%s\n", encdata);
+ if (encdata != NULL)
+ fprintf(fp, "X-Sylpheed-Encrypt-Data:%s\n",
+ encdata);
g_free(encdata);
}
}
/* Subject */
str = gtk_editable_get_chars(GTK_EDITABLE(compose->subject_entry), 0, -1);
if (*str != '\0' && !IS_IN_CUSTOM_HEADER("Subject")) {
- gchar *tmpstr;
-
- tmpstr = g_strdup(str);
- if (tmpstr == NULL) {
- g_string_free(header, TRUE);
- return NULL;
- }
g_strstrip(str);
if (*str != '\0') {
compose_convert_header(buf, sizeof(buf), str,
strlen("Subject: "), FALSE);
g_string_append_printf(header, "Subject: %s\n", buf);
}
- g_free(tmpstr);
}
g_free(str);
/* Message-ID */
if (compose->account->gen_msgid) {
- generate_msgid(compose->account->address, buf, sizeof(buf));
+ generate_msgid(buf, sizeof(buf));
g_string_append_printf(header, "Message-ID: <%s>\n", buf);
compose->msgid = g_strdup(buf);
}