commit a9a30e9f42f3e44a35e60fa05caaec77b596a7f7
parent 8c5496662cb6321c8efd7190d1464b4f105f3be5
Author: Colin Leroy <colin@colino.net>
Date: Wed, 17 Nov 2010 19:32:19 +0000
2010-11-17 [colin] 3.7.6cvs64
* src/common/utils.c
Fix multiple @ in generated message-ids.
That's not allowed in RFC 2822.
Diffstat:
4 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-17 [colin] 3.7.6cvs64
+
+ * src/common/utils.c
+ Fix multiple @ in generated message-ids.
+ That's not allowed in RFC 2822.
+
2010-11-16 [mones] 3.7.6cvs63
* manual/es/advanced.xml
diff --git a/PATCHSETS b/PATCHSETS
@@ -4059,3 +4059,4 @@
( cvs diff -u -r 1.28.2.43 -r 1.28.2.44 src/addrindex.c; ) > 3.7.6cvs61.patchset
( cvs diff -u -r 1.60.2.55 -r 1.60.2.56 src/filtering.c; ) > 3.7.6cvs62.patchset
( cvs diff -u -r 1.1.2.15 -r 1.1.2.16 manual/es/advanced.xml; ) > 3.7.6cvs63.patchset
+( cvs diff -u -r 1.36.2.187 -r 1.36.2.188 src/common/utils.c; ) > 3.7.6cvs64.patchset
diff --git a/configure.ac b/configure.ac
@@ -12,7 +12,7 @@ MINOR_VERSION=7
MICRO_VERSION=6
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=63
+EXTRA_VERSION=64
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
diff --git a/src/common/utils.c b/src/common/utils.c
@@ -3870,6 +3870,12 @@ gchar *generate_msgid(gchar *buf, gint len, gchar *user_addr)
}
}
+ /* Replace all @ but the last one in addr, with underscores.
+ * RFC 2822 States that msg-id syntax only allows one @.
+ */
+ while (strchr(addr, '@') != NULL && strchr(addr, '@') != strrchr(addr, '@'))
+ *(strchr(addr, '@')) = '_';
+
g_snprintf(buf, len, "%04d%02d%02d%02d%02d%02d.%08x%s",
lt->tm_year + 1900, lt->tm_mon + 1,
lt->tm_mday, lt->tm_hour,