* src/compose.c
use ", " as address seperator for mail headers and pass whole
header line at once to compose_convert_header to make sure
it is correctly folded
(closes Bug 64 Problem when sending to many recipients)
+2003-09-17 [christoph] 0.9.5claws19
+
+ * src/compose.c
+ use ", " as address seperator for mail headers and pass whole
+ header line at once to compose_convert_header to make sure
+ it is correctly folded
+
+ (closes Bug 64 Problem when sending to many recipients)
+
2003-09-17 [hoa] 0.9.5claws18
* changed the keyword used for command execution in condition
2003-09-17 [hoa] 0.9.5claws18
* changed the keyword used for command execution in condition
MICRO_VERSION=5
INTERFACE_AGE=0
BINARY_AGE=0
MICRO_VERSION=5
INTERFACE_AGE=0
BINARY_AGE=0
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
else
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
else
static gint compose_write_headers_from_headerlist(Compose *compose,
FILE *fp,
static gint compose_write_headers_from_headerlist(Compose *compose,
FILE *fp,
+ const gchar *header,
+ const gchar *seperator)
gchar *str, *header_w_colon, *trans_hdr;
gchar *str, *header_w_colon, *trans_hdr;
- gboolean first_address;
+ gboolean write_header = FALSE;
GSList *list;
ComposeHeaderEntry *headerentry;
gchar * headerentryname;
GSList *list;
ComposeHeaderEntry *headerentry;
gchar * headerentryname;
if (IS_IN_CUSTOM_HEADER(header)) {
return 0;
if (IS_IN_CUSTOM_HEADER(header)) {
return 0;
debug_print("Writing %s-header\n", header);
debug_print("Writing %s-header\n", header);
+ headerstr = g_string_sized_new(64);
+
header_w_colon = g_strconcat(header, ":", NULL);
trans_hdr = (prefs_common.trans_hdr ? gettext(header_w_colon) : header_w_colon);
header_w_colon = g_strconcat(header, ":", NULL);
trans_hdr = (prefs_common.trans_hdr ? gettext(header_w_colon) : header_w_colon);
for (list = compose->header_list; list; list = list->next) {
headerentry = ((ComposeHeaderEntry *)list->data);
headerentryname = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(headerentry->combo)->entry));
for (list = compose->header_list; list; list = list->next) {
headerentry = ((ComposeHeaderEntry *)list->data);
headerentryname = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(headerentry->combo)->entry));
Xstrdup_a(str, str, return -1);
g_strstrip(str);
if (str[0] != '\0') {
Xstrdup_a(str, str, return -1);
g_strstrip(str);
if (str[0] != '\0') {
- compose_convert_header
- (buf, sizeof(buf), str,
- strlen(header) + 2, TRUE);
- if (first_address) {
- fprintf(fp, "%s: ", header);
- first_address = FALSE;
- } else {
- fprintf(fp, ",");
- }
- fprintf(fp, "%s", buf);
+ g_string_append(headerstr, str);
+ if (write_header)
+ g_string_append(headerstr, seperator);
+ write_header = TRUE;
- if (!first_address) {
- fprintf(fp, "\n");
+ if (write_header) {
+ gchar *buf;
+
+ buf = g_new0(gchar, headerstr->len * 2);
+ compose_convert_header
+ (buf, headerstr->len * 2, headerstr->str,
+ strlen(header) + 2, TRUE);
+ fprintf(fp, "%s: %s\n", header, buf);
+ g_free(buf);
}
g_free(header_w_colon);
}
g_free(header_w_colon);
+ g_string_free(headerstr, TRUE);
- compose_write_headers_from_headerlist(compose, fp, "To");
+ compose_write_headers_from_headerlist(compose, fp, "To", ", ");
#if 0 /* NEW COMPOSE GUI */
if (compose->use_to) {
str = gtk_entry_get_text(GTK_ENTRY(compose->to_entry));
#if 0 /* NEW COMPOSE GUI */
if (compose->use_to) {
str = gtk_entry_get_text(GTK_ENTRY(compose->to_entry));
- compose_write_headers_from_headerlist(compose, fp, "Newsgroups");
+ compose_write_headers_from_headerlist(compose, fp, "Newsgroups", ",");
#if 0 /* NEW COMPOSE GUI */
if (compose->use_newsgroups) {
str = gtk_entry_get_text(GTK_ENTRY(compose->newsgroups_entry));
#if 0 /* NEW COMPOSE GUI */
if (compose->use_newsgroups) {
str = gtk_entry_get_text(GTK_ENTRY(compose->newsgroups_entry));
- compose_write_headers_from_headerlist(compose, fp, "Cc");
+ compose_write_headers_from_headerlist(compose, fp, "Cc", ", ");
#if 0 /* NEW COMPOSE GUI */
if (compose->use_cc) {
str = gtk_entry_get_text(GTK_ENTRY(compose->cc_entry));
#if 0 /* NEW COMPOSE GUI */
if (compose->use_cc) {
str = gtk_entry_get_text(GTK_ENTRY(compose->cc_entry));
- compose_write_headers_from_headerlist(compose, fp, "Bcc");
+ compose_write_headers_from_headerlist(compose, fp, "Bcc", ", ");
#if 0 /* NEW COMPOSE GUI */
if (compose->use_bcc) {
str = gtk_entry_get_text(GTK_ENTRY(compose->bcc_entry));
#if 0 /* NEW COMPOSE GUI */
if (compose->use_bcc) {
str = gtk_entry_get_text(GTK_ENTRY(compose->bcc_entry));
- compose_write_headers_from_headerlist(compose, fp, "Followup-To");
+ compose_write_headers_from_headerlist(compose, fp, "Followup-To", ",");
#if 0 /* NEW COMPOSE GUI */
if (compose->use_followupto && !IS_IN_CUSTOM_HEADER("Followup-To")) {
str = gtk_entry_get_text(GTK_ENTRY(compose->followup_entry));
#if 0 /* NEW COMPOSE GUI */
if (compose->use_followupto && !IS_IN_CUSTOM_HEADER("Followup-To")) {
str = gtk_entry_get_text(GTK_ENTRY(compose->followup_entry));
- compose_write_headers_from_headerlist(compose, fp, "Reply-To");
+ compose_write_headers_from_headerlist(compose, fp, "Reply-To", ", ");
#if 0 /* NEW COMPOSE GUI */
if (compose->use_replyto && !IS_IN_CUSTOM_HEADER("Reply-To")) {
str = gtk_entry_get_text(GTK_ENTRY(compose->reply_entry));
#if 0 /* NEW COMPOSE GUI */
if (compose->use_replyto && !IS_IN_CUSTOM_HEADER("Reply-To")) {
str = gtk_entry_get_text(GTK_ENTRY(compose->reply_entry));