2009-06-12 [mones] 3.7.1cvs74
authorRicardo Mones <mones@claws-mail.org>
Fri, 12 Jun 2009 10:02:11 +0000 (10:02 +0000)
committerRicardo Mones <mones@claws-mail.org>
Fri, 12 Jun 2009 10:02:11 +0000 (10:02 +0000)
* src/compose.c
* src/messageview.c
* src/prefs_account.c
* src/prefs_account.h
* src/common/utils.c
* src/common/utils.h
Added preference to use account address in generated
Message-Id. Fixes Debian bug #531052

ChangeLog
PATCHSETS
configure.ac
src/common/utils.c
src/common/utils.h
src/compose.c
src/messageview.c
src/prefs_account.c
src/prefs_account.h

index 3b8fd3e..fa29a8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-06-12 [mones]     3.7.1cvs74
+
+       * src/compose.c
+       * src/messageview.c
+       * src/prefs_account.c
+       * src/prefs_account.h
+       * src/common/utils.c
+       * src/common/utils.h
+               Added preference to use account address in generated
+               Message-Id. Fixes Debian bug #531052
+
 2009-06-12 [colin]     3.7.1cvs73
 
        * src/common/ssl.c
index 7801114..01c0acc 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.516 -r 1.382.2.517 src/compose.c;  ) > 3.7.1cvs71.patchset
 ( cvs diff -u -r 1.9.2.40 -r 1.9.2.41 src/common/ssl.c;  ) > 3.7.1cvs72.patchset
 ( cvs diff -u -r 1.9.2.41 -r 1.9.2.42 src/common/ssl.c;  ) > 3.7.1cvs73.patchset
+( cvs diff -u -r 1.382.2.517 -r 1.382.2.518 src/compose.c;  cvs diff -u -r 1.94.2.204 -r 1.94.2.205 src/messageview.c;  cvs diff -u -r 1.105.2.153 -r 1.105.2.154 src/prefs_account.c;  cvs diff -u -r 1.49.2.43 -r 1.49.2.44 src/prefs_account.h;  cvs diff -u -r 1.36.2.171 -r 1.36.2.172 src/common/utils.c;  cvs diff -u -r 1.20.2.70 -r 1.20.2.71 src/common/utils.h;  ) > 3.7.1cvs74.patchset
index 8c48d37..9c28604 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=73
+EXTRA_VERSION=74
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 52860ec..276bbb1 100644 (file)
@@ -3815,7 +3815,7 @@ gint g_int_compare(gconstpointer a, gconstpointer b)
        return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
 }
 
-gchar *generate_msgid(gchar *buf, gint len)
+gchar *generate_msgid(gchar *buf, gint len, gchar *user_addr)
 {
        struct tm *lt;
        time_t t;
@@ -3828,10 +3828,20 @@ gchar *generate_msgid(gchar *buf, gint len)
        lt = localtime_r(&t, &buft);
 
        if (strcmp(buf, "") == 0) {
-               addr = g_strconcat("@", get_domain_name(), NULL);
+               if (user_addr != NULL) {
+                       addr = g_strconcat(user_addr, "@", get_domain_name(), NULL);
+               }
+               else {
+                       addr = g_strconcat("@", get_domain_name(), NULL);
+               }
        }
        else {
-               addr = g_strconcat("@", buf, NULL);
+               if (user_addr != NULL) {
+                       addr = g_strconcat(user_addr, "@", buf, NULL);
+               }
+               else {
+                       addr = g_strconcat("@", buf, NULL);
+               }
        }
 
        g_snprintf(buf, len, "%04d%02d%02d%02d%02d%02d.%08x%s",
index 92f0d5e..807e631 100644 (file)
@@ -536,7 +536,7 @@ const gchar * line_has_quote_char   (const gchar *str,
 
 gint g_int_compare     (gconstpointer a, gconstpointer b);
 
-gchar *generate_msgid          (gchar *buf, gint len);
+gchar *generate_msgid          (gchar *buf, gint len, gchar *user_addr);
 gchar *generate_mime_boundary  (const gchar *prefix);
 
 gint quote_cmd_argument(gchar * result, guint size,
index 654f675..6fe0204 100644 (file)
@@ -5065,7 +5065,11 @@ static gint compose_redirect_write_headers(Compose *compose, FILE *fp)
        }
 
        if (compose->account->gen_msgid) {
-               generate_msgid(buf, sizeof(buf));
+               gchar *addr = NULL;
+               if (compose->account->msgid_with_addr) {
+                       addr = compose->account->address;
+               }
+               generate_msgid(buf, sizeof(buf), addr);
                err |= (fprintf(fp, "Resent-Message-ID: <%s>\n", buf) < 0);
                compose->msgid = g_strdup(buf);
        } else {
@@ -6033,7 +6037,11 @@ static gchar *compose_get_header(Compose *compose)
        }
        
        if (compose->account->gen_msgid) {
-               generate_msgid(buf, sizeof(buf));
+               gchar *addr = NULL;
+               if (compose->account->msgid_with_addr) {
+                       addr = compose->account->address;
+               }
+               generate_msgid(buf, sizeof(buf), addr);
                g_string_append_printf(header, "Message-ID: <%s>\n", buf);
                compose->msgid = g_strdup(buf);
        } else {
index b4eb09f..915ab38 100644 (file)
@@ -964,7 +964,11 @@ static gint disposition_notification_send(MsgInfo *msginfo)
        }
        
        if (account->gen_msgid) {
-               generate_msgid(buf, sizeof(buf));
+               gchar *addr = NULL;
+               if (account->msgid_with_addr) {
+                       addr = account->address;
+               }
+               generate_msgid(buf, sizeof(buf), addr);
 
                if (fprintf(fp, "Message-ID: <%s>\n", buf) < 0) {
                        fclose(fp);
index cef79cc..79f8be2 100644 (file)
@@ -282,6 +282,7 @@ typedef struct AdvancedPage
        GtkWidget *nntpport_spinbtn;
        GtkWidget *domain_checkbtn;
        GtkWidget *domain_entry;
+       GtkWidget *msgid_with_addr_checkbtn;
        GtkWidget *crosspost_checkbtn;
        GtkWidget *crosspost_colormenu;
 
@@ -793,6 +794,10 @@ static PrefParam advanced_param[] = {
        {"domain", NULL, &tmp_ac_prefs.domain, P_STRING,
         &advanced_page.domain_entry,
         prefs_set_data_from_entry, prefs_set_entry},
+
+       {"msgid_with_addr", "FALSE", &tmp_ac_prefs.msgid_with_addr, P_BOOL,
+        &advanced_page.msgid_with_addr_checkbtn,
+        prefs_set_data_from_toggle, prefs_set_toggle},
 #ifndef G_OS_WIN32
        {"set_tunnelcmd", "FALSE", &tmp_ac_prefs.set_tunnelcmd, P_BOOL,
         &advanced_page.tunnelcmd_checkbtn,
@@ -2529,6 +2534,7 @@ static void advanced_create_widget_func(PrefsPage * _page,
        GtkWidget *spinbtn_nntpport;
        GtkWidget *checkbtn_domain;
        GtkWidget *entry_domain;
+       GtkWidget *checkbtn_msgid_with_addr;
        GtkWidget *checkbtn_crosspost;
        GtkWidget *colormenu_crosspost;
        GtkWidget *menu;
@@ -2615,7 +2621,9 @@ static void advanced_create_widget_func(PrefsPage * _page,
                             _("The domain name will be used in the right part of "
                               "the generated Message-Ids, and when connecting to "
                               "SMTP servers."));
-
+       PACK_HBOX (hbox1);
+       PACK_CHECK_BUTTON (hbox1, checkbtn_msgid_with_addr,
+                          _("Send account mail address in Message-Id"));
 
 #ifndef G_OS_WIN32     
        PACK_HBOX (hbox1);
@@ -2705,6 +2713,7 @@ static void advanced_create_widget_func(PrefsPage * _page,
        page->nntpport_spinbtn          = spinbtn_nntpport;
        page->domain_checkbtn           = checkbtn_domain;
        page->domain_entry              = entry_domain;
+       page->msgid_with_addr_checkbtn  = checkbtn_msgid_with_addr;
        page->crosspost_checkbtn        = checkbtn_crosspost;
        page->crosspost_colormenu       = colormenu_crosspost;
 
index a737d02..c169668 100644 (file)
@@ -164,6 +164,7 @@ struct _PrefsAccount
        gushort   nntpport;
        gboolean  set_domain;
        gchar    *domain;
+       gboolean  msgid_with_addr;
        gboolean  mark_crosspost_read;
        gint      crosspost_col;