tmpl->from = NULL;
tmpl->to = NULL;
tmpl->cc = NULL;
- tmpl->bcc = NULL;
+ tmpl->bcc = NULL;
+ tmpl->replyto = NULL;
tmpl->value = NULL;
while (fgets(buf, sizeof(buf), fp) != NULL) {
tmpl->cc = g_strdup(g_strstrip(buf + 3));
else if (!g_ascii_strncasecmp(buf, "Bcc:", 4))
tmpl->bcc = g_strdup(g_strstrip(buf + 4));
+ else if (!g_ascii_strncasecmp(buf, "Reply-To:", 9))
+ tmpl->replyto = g_strdup(g_strstrip(buf + 9));
else if (!g_ascii_strncasecmp(buf, "Subject:", 8))
tmpl->subject = g_strdup(g_strstrip(buf + 8));
}
g_free(tmpl->to);
g_free(tmpl->cc);
g_free(tmpl->bcc);
+ g_free(tmpl->replyto);
g_free(tmpl->value);
g_free(tmpl);
}
TRY(fprintf(fp, "Cc: %s\n", tmpl->cc) > 0);
if (tmpl->bcc && *tmpl->bcc != '\0')
TRY(fprintf(fp, "Bcc: %s\n", tmpl->bcc) > 0);
+ if (tmpl->replyto && *tmpl->replyto != '\0')
+ TRY(fprintf(fp, "Reply-To: %s\n", tmpl->replyto) > 0);
TRY(fputs("\n", fp) != EOF);
}
}
+ if (tmpl->replyto && *tmpl->replyto != '\0') {
+#ifdef USE_ENCHANT
+ quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
+ compose->gtkaspell);
+#else
+ quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE);
+#endif
+ quote_fmt_scan_string(tmpl->replyto);
+ quote_fmt_parse();
+
+ buf = quote_fmt_get_buffer();
+ if (buf == NULL) {
+ alertpanel_error(_("Template Reply-To format error."));
+ } else {
+ compose_entry_append(compose, buf, COMPOSE_REPLYTO, PREF_TEMPLATE);
+ }
+ }
+
/* process the subject */
if (tmpl->subject && *tmpl->subject != '\0') {
#ifdef USE_ENCHANT
GtkWidget *entry_to;
GtkWidget *entry_cc;
GtkWidget *entry_bcc;
+ GtkWidget *entry_replyto;
GtkWidget *text_value;
} templates;
{"To", &templates.entry_to, TRUE, NULL},
{"Cc", &templates.entry_cc, TRUE, NULL},
{"Bcc", &templates.entry_bcc, TRUE, NULL},
+ {"Reply-To", &templates.entry_replyto, TRUE, NULL},
{"Subject", &templates.entry_subject, FALSE, NULL},
{NULL, NULL, FALSE, NULL}
};
GtkWidget *scrolled_window;
GtkWidget *vpaned;
GtkWidget *vbox1;
- GtkWidget *table; /* including : entry_[name|from|to|cc|bcc|subject] */
+ GtkWidget *table; /* including : entry_[name|from|to|cc|bcc|replyto|subject] */
GtkWidget *scroll2;
GtkWidget *text_value;
GtkWidget *vbox2;
gtk_entry_set_text(GTK_ENTRY(templates.entry_to), "");
gtk_entry_set_text(GTK_ENTRY(templates.entry_cc), "");
gtk_entry_set_text(GTK_ENTRY(templates.entry_bcc), "");
+ gtk_entry_set_text(GTK_ENTRY(templates.entry_replyto), "");
gtk_entry_set_text(GTK_ENTRY(templates.entry_subject), "");
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(templates.text_value));
ntmpl->bcc = tmpl->bcc && *(tmpl->bcc)
? g_strdup(tmpl->bcc)
: NULL;
+ ntmpl->replyto = tmpl->replyto && *(tmpl->replyto)
+ ? g_strdup(tmpl->replyto)
+ : NULL;
ntmpl->value = tmpl->value && *(tmpl->value)
? g_strdup(tmpl->value)
: NULL;
gchar *from;
gchar *to;
gchar *cc;
- gchar *bcc;
+ gchar *bcc;
+ gchar *replyto;
gchar *value;
GtkTextBuffer *buffer;
GtkTextIter start, end;
0, -1);
bcc = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_bcc),
0, -1);
+ replyto = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_replyto),
+ 0, -1);
subject = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_subject),
0, -1);
g_free(bcc);
bcc = NULL;
}
+ if (replyto && *replyto == '\0') {
+ g_free(replyto);
+ replyto = NULL;
+ }
if (subject && *subject == '\0') {
g_free(subject);
subject = NULL;
g_free(value);
return FALSE;
}
+ if (!prefs_template_string_is_valid(replyto, NULL, TRUE, TRUE)) {
+ alertpanel_error(_("The \"Replyt-To\" field of the template contains an invalid email address."));
+ g_free(replyto);
+ g_free(value);
+ return FALSE;
+ }
if (!prefs_template_string_is_valid(subject, NULL, TRUE, FALSE)) {
alertpanel_error(_("The \"Subject\" field of the template is invalid."));
g_free(subject);
tmpl->to = to;
tmpl->cc = cc;
tmpl->bcc = bcc;
+ tmpl->replyto = replyto;
tmpl->value = value;
prefs_template_list_view_insert_template(templates.list_view,
tmpl_def.to = "";
tmpl_def.cc = "";
tmpl_def.bcc = "";
+ tmpl_def.replyto = "";
tmpl_def.value = "";
gtk_tree_model_get(model, &titer, TEMPL_DATA, &tmpl, -1);
tmpl->cc ? tmpl->cc : "");
gtk_entry_set_text(GTK_ENTRY(templates.entry_bcc),
tmpl->bcc ? tmpl->bcc : "");
+ gtk_entry_set_text(GTK_ENTRY(templates.entry_replyto),
+ tmpl->replyto ? tmpl->replyto : "");
gtk_entry_set_text(GTK_ENTRY(templates.entry_subject),
tmpl->subject ? tmpl->subject : "");