From: Tomi Ollila Date: Wed, 18 Apr 2012 16:00:26 +0000 (+0300) Subject: Re: [PATCH v2 1/3] Add 'compose' command X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=9c790c50619ca442ea18f813bed34b92c9d9a38f;p=notmuch-archives.git Re: [PATCH v2 1/3] Add 'compose' command --- diff --git a/63/d714935f30c7d553cd0e71ad617f926066a737 b/63/d714935f30c7d553cd0e71ad617f926066a737 new file mode 100644 index 000000000..4c60870ce --- /dev/null +++ b/63/d714935f30c7d553cd0e71ad617f926066a737 @@ -0,0 +1,114 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 79C76431FB6 + for ; Wed, 18 Apr 2012 09:00:34 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 6gCDMd07H6lC for ; + Wed, 18 Apr 2012 09:00:30 -0700 (PDT) +Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66]) + by olra.theworths.org (Postfix) with ESMTP id B63CF431FAE + for ; Wed, 18 Apr 2012 09:00:29 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 9387568055; Wed, 18 Apr 2012 19:00:26 +0300 (EEST) +From: Tomi Ollila +To: Felipe Contreras , + Jani Nikula +Subject: Re: [PATCH v2 1/3] Add 'compose' command +In-Reply-To: + +References: <1334752753-23970-1-git-send-email-felipe.contreras@gmail.com> + <1334752753-23970-2-git-send-email-felipe.contreras@gmail.com> + <873981chpj.fsf@nikula.org> + + <87vckxazq7.fsf@nikula.org> + +User-Agent: Notmuch/0.12+113~gde05574 (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: Felipe Contreras , notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 18 Apr 2012 16:00:34 -0000 + +On Wed, Apr 18 2012, Felipe Contreras wrote: + +> On Wed, Apr 18, 2012 at 5:20 PM, Jani Nikula wrote: +>> On Wed, 18 Apr 2012 16:34:30 +0300, Felipe Contreras wrote: +>>> On Wed, Apr 18, 2012 at 4:06 PM, Jani Nikula wrote: +>>> +>>> > Running "notmuch compose" more than once within a second would result in +>>> > identical message ids for the messages, which is not a good idea. That's +>>> > not likely in interactive use, but the notmuch cli is highly scriptable, +>>> > so someone is bound to hit this. +>>> > +>>> > Some paranoid might also be worried about "leaking" the time you run +>>> > "notmuch compose"... which may be different from the actual time you +>>> > send the message. +>>> +>>> It's still better than the current situation; nothing. In any case, +>>> people that have not needed this would not be affected; their UI would +>>> override the Message-ID. +>>> +>>> So do you have a better suggestion for a Message-ID? +>> +>> The easy way would be to just use g_mime_utils_generate_message_id() +>> [1]. It doesn't give you any control of the part before @, but I'm not +>> sure if that really matters. +> +> This is what gmime does: +> g_strdup_printf ("%lu.%lu.%lu@%s", (unsigned long int) time (NULL), +> (unsigned long int) getpid (), count++, fqdn); +> +> Which actually has some of the issues you mentioned. +> +> I can do the same if you want (add pid and count). The advantage of +> using our own format is that not only would it be more unique, but it +> would not have "@fqdn". + +getpid() is good. I guess count is useless (always one). Now some ideas +how to obfuscate time(NULL) (nonce + hash (crc32 good enough?) ? + +Tomi + +> +>> Alternatively you can write your own according to e.g. [2]. Glib appears +>> to have decent and portable support for pseudo random number +>> generation. But why bother? I'd go with gmime. +> +> But gmime doesn't have anything random. I would actually prefer to +> have something random though. + + + +> +> -- +> Felipe Contreras +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch