Re: [Evolution-hackers] Message-ID

2011-09-29 Thread Milan Crha
On Wed, 2011-09-28 at 12:30 +0200, venom00 wrote:
 Hello, I've come up with a simple patch to change the generated
 Message-IDs. Currently they're like:
 {UNIX-time}.{Evolution PID}.{Mail Counter since Evolution
 Start}@{Machine Name}
 
 I've simply taken it, computed the SHA512, put it in BASE64 and then I
 append @evolution.gnome.org
 
 Message-id:
 alo-zywa3vbqywsp0a8fb3qzu-2r36dmqn7dxtpyvq9vbsoslp0urdkwy9ceyt654zmgbj_byk19gt-3czm...@evolution.gnome.org
 
 Comments, critics or simple rejection are welcome. Feel free to change
 or improve the patch, which is GPL'd.
 
 I've worked on gnome-2-32 branch.

Hi,
I'm sorry, but I do not understand it, what is it good for? The only
change I see is that the message IDs would be unnecessary long and
unreadable with your patch (though who does want to read it). I do not
see any issue with current approach of generating Message IDs in Camel,
neither with RFC 5322 [1], which, I confess, I only briefly searched for
message-id string.
Bye,
Milan

[1] http://tools.ietf.org/html/rfc5322

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Message-ID

2011-09-29 Thread venom00
   Hi,
 I'm sorry, but I do not understand it, what is it good for? The only
 change I see is that the message IDs would be unnecessary long and
 unreadable with your patch (though who does want to read it). 

Well, if it looks to long I can switch to SHA-256 and halve the length.

 I do not
 see any issue with current approach of generating Message IDs in Camel,
 neither with RFC 5322 [1], which, I confess, I only briefly searched for
 message-id string.

It's not a matter for RFC, the fact is that I don't think is a good idea
to give away the evolution PID, the creation time and the mail count.

e.g.
You:
Message-ID: 01:00 AM - PID: 123 - Message count: 456
OK, tell me what to do!

Enemy:
Did you restarted Evolution as I told you? If you read
my message before 12:00 AM I'll kill you! And don't try 
to write to anyone else!

You:
Message-ID: 11:00 AM - PID: 123 - Message count: 512
Sure!

It's a real life example!
This is a joke, but one could obtain a lot of information about user
activity if he has a good amount of e-mail, a mailing list for example.

Do you consider the patch invasive?

Have a nice day!
venom00

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Message-ID

2011-09-29 Thread Milan Crha
On Thu, 2011-09-29 at 10:35 +0200, venom00 wrote:
  Hi,
  I'm sorry, but I do not understand it, what is it good for? The only
  change I see is that the message IDs would be unnecessary long and
  unreadable with your patch (though who does want to read it). 
 
 Well, if it looks to long I can switch to SHA-256 and halve the length.
 
  I do not
  see any issue with current approach of generating Message IDs in Camel,
  neither with RFC 5322 [1], which, I confess, I only briefly searched for
  message-id string.
 
 It's not a matter for RFC, the fact is that I don't think is a good idea
 to give away the evolution PID, the creation time and the mail count.

Hi,
it's not the mail count, it's count of calls for the message ID
generation function, which is very different and I do not expect it
being any private information, especially because it's tight to
evolution instance currently running, same as the PID. Time is set in
the Date header as well.

The current way of generating message-id is pretty much standardized.
I would change anything on it personally, I'm sorry.
Bye,
Milan

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Message-ID

2011-09-29 Thread Milan Crha
On Thu, 2011-09-29 at 11:24 +0200, Milan Crha wrote:
 I would change anything on it personally, I'm sorry.

Oops, typo, it should be:
I would _not_ change anything on it personally, I'm sorry.

(Thanks Akhil, for notifying me.)

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


[Evolution-hackers] Message-ID

2011-09-28 Thread venom00
Hello, I've come up with a simple patch to change the generated
Message-IDs. Currently they're like:
{UNIX-time}.{Evolution PID}.{Mail Counter since Evolution
Start}@{Machine Name}

I've simply taken it, computed the SHA512, put it in BASE64 and then I
append @evolution.gnome.org

Message-id:
alo-zywa3vbqywsp0a8fb3qzu-2r36dmqn7dxtpyvq9vbsoslp0urdkwy9ceyt654zmgbj_byk19gt-3czm...@evolution.gnome.org

Comments, critics or simple rejection are welcome. Feel free to change
or improve the patch, which is GPL'd.

I've worked on gnome-2-32 branch.

Have a nice day!
venom00


diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 8e51497..952c2af 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -56,6 +56,9 @@
 #endif
 #include camel-utf8.h
 
+#include nss/sechash.h
+#include glib.h
+
 #ifdef G_OS_WIN32
 #ifdef gmtime_r
 #undef gmtime_r
@@ -4398,6 +4401,9 @@ camel_header_msgid_generate (void)
gint retval;
struct addrinfo *ai = NULL, hints = { 0 };
static gchar *cached_hostname = NULL;
+   guchar hash[SHA512_LENGTH];
+   gchar *base64_hash = NULL;
+   gint i = 0;
 
if (!cached_hostname) {
retval = gethostname (host, sizeof (host));
@@ -4417,7 +4423,23 @@ camel_header_msgid_generate (void)
COUNT_LOCK ();
msgid = g_strdup_printf (%d.%d.%d.camel@%s, (gint) time (NULL),
getpid (), count++, cached_hostname);
COUNT_UNLOCK ();
-
+   
+   HASH_HashBuf(HASH_AlgSHA512, hash, (guchar *) msgid, strlen(msgid));
+   g_free(msgid);
+   base64_hash = g_base64_encode(hash, sizeof (hash));
+
+   base64_hash[sizeof(hash)*8/6+1] = '\0';
+   for (i = 0; i  strlen(base64_hash); i++) {
+   if (base64_hash[i] == '/') {
+   base64_hash[i] = '_';
+   } else if (base64_hash[i] == '+') {
+   base64_hash[i] = '-';
+   }
+   }
+ 
+   msgid = g_strdup_printf (%s@%s, base64_hash, evolution.gnome.org);
+   g_free(base64_hash);
+   
if (ai)
camel_freeaddrinfo(ai);
 
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 8e51497..952c2af 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -56,6 +56,9 @@
 #endif
 #include camel-utf8.h
 
+#include nss/sechash.h
+#include glib.h
+
 #ifdef G_OS_WIN32
 #ifdef gmtime_r
 #undef gmtime_r
@@ -4398,6 +4401,9 @@ camel_header_msgid_generate (void)
 	gint retval;
 	struct addrinfo *ai = NULL, hints = { 0 };
 	static gchar *cached_hostname = NULL;
+	guchar hash[SHA512_LENGTH];
+	gchar *base64_hash = NULL;
+	gint i = 0;
 
 	if (!cached_hostname) {
 		retval = gethostname (host, sizeof (host));
@@ -4417,7 +4423,23 @@ camel_header_msgid_generate (void)
 	COUNT_LOCK ();
 	msgid = g_strdup_printf (%d.%d.%d.camel@%s, (gint) time (NULL), getpid (), count++, cached_hostname);
 	COUNT_UNLOCK ();
-
+	
+	HASH_HashBuf(HASH_AlgSHA512, hash, (guchar *) msgid, strlen(msgid));
+	g_free(msgid);
+	base64_hash = g_base64_encode(hash, sizeof (hash));
+
+	base64_hash[sizeof(hash)*8/6+1] = '\0';
+	for (i = 0; i  strlen(base64_hash); i++) {
+		if (base64_hash[i] == '/') {
+			base64_hash[i] = '_';
+		} else if (base64_hash[i] == '+') {
+			base64_hash[i] = '-';
+		}
+	}
+	  
+	msgid = g_strdup_printf (%s@%s, base64_hash, evolution.gnome.org);
+	g_free(base64_hash);
+	
 	if (ai)
 		camel_freeaddrinfo(ai);
 
___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers