From 1983a97f1499ad7e211fbe5739016467ecee05af Mon Sep 17 00:00:00 2001 From: Dmitry Kurochkin Date: Wed, 18 Apr 2012 20:10:47 +0400 Subject: [PATCH] Re: [PATCH v2 1/3] Add 'compose' command --- 73/fecaadea71dc95be7e41f6fccdb8f0192ed142 | 148 ++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 73/fecaadea71dc95be7e41f6fccdb8f0192ed142 diff --git a/73/fecaadea71dc95be7e41f6fccdb8f0192ed142 b/73/fecaadea71dc95be7e41f6fccdb8f0192ed142 new file mode 100644 index 000000000..6e0b8ccb9 --- /dev/null +++ b/73/fecaadea71dc95be7e41f6fccdb8f0192ed142 @@ -0,0 +1,148 @@ +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 1CC21431FDE + for ; Wed, 18 Apr 2012 09:12:45 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 Mr+GXZzoGscf for ; + Wed, 18 Apr 2012 09:12:40 -0700 (PDT) +Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com + [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 18289431FAE + for ; Wed, 18 Apr 2012 09:12:39 -0700 (PDT) +Received: by lahc1 with SMTP id c1so5972279lah.26 + for ; Wed, 18 Apr 2012 09:12:38 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:in-reply-to:references:user-agent:date + :message-id:mime-version:content-type; + bh=Ir5wpoHOAT67wPEe+M73vBy98rn4prhCvDOSpvdsgBE=; + b=aJfwht5C2XRYE5/PcQRzou47F00SY8vITCqJMNci0mfJdTapX8eMT8QOS6qjQm7t0y + pMhH9uGidIZivsvHnjC/cDMe3rjQ/TGrIpFcCjZAIiZmaN2FiKs69gASmkv5m2lh5dRI + IaT0yTix63xatiZ3F4zgA67WCx2jmj6YEjbhBxd6NG+6ElEGNOOuqZMWGPFQ/6iJuQaw + pA5hYYdecK4qDX9UPco7bswBgM1vsUONjNbF8zmDZ0lqkyeN93RwQkHQldomGUocdS2e + mnRd73LBVd3YLyV9KTaeI2plMG+Ofd3rDgJa+w2J4fdVASjiNSUSYrJ4p7J8fNkS5E7K + APrg== +Received: by 10.112.42.100 with SMTP id n4mr1307250lbl.90.1334765558362; + Wed, 18 Apr 2012 09:12:38 -0700 (PDT) +Received: from localhost ([91.144.186.21]) + by mx.google.com with ESMTPS id mr15sm26721812lab.8.2012.04.18.09.12.37 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 18 Apr 2012 09:12:37 -0700 (PDT) +From: Dmitry Kurochkin +To: Tomi Ollila , + 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+104~gf9ad237 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Wed, 18 Apr 2012 20:10:47 +0400 +Message-ID: <87ty0hkol4.fsf@gmail.com> +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:12:45 -0000 + +Tomi Ollila writes: + +> 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?) ? +> + +I think the best would be for notmuch to use the gmime function and +change gmime (open a bug, may be provide a patch) to follow the best +practice for Message-ID generation (I guess that would be the document +pointed by Jani [1]). + +Regards, + Dmitry + +[1] http://www.jwz.org/doc/mid.html + +> 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 +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2