From: Felipe Contreras Date: Wed, 18 Apr 2012 15:39:20 +0000 (+0300) Subject: Re: [PATCH v2 1/3] Add 'compose' command X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=929b83c187a592440ab3a231d8ba0d51a00eb1ff;p=notmuch-archives.git Re: [PATCH v2 1/3] Add 'compose' command --- diff --git a/21/e73e26b9204e2454c547a1854a6a811ede0883 b/21/e73e26b9204e2454c547a1854a6a811ede0883 new file mode 100644 index 000000000..b582ab947 --- /dev/null +++ b/21/e73e26b9204e2454c547a1854a6a811ede0883 @@ -0,0 +1,108 @@ +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 4F88F431FB6 + for ; Wed, 18 Apr 2012 08:39:26 -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 528QkK-eErtN for ; + Wed, 18 Apr 2012 08:39:22 -0700 (PDT) +Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com + [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 068BC431FAE for ; Wed, 18 Apr 2012 08:39:21 -0700 + (PDT) +Received: by eekb47 with SMTP id b47so3111031eek.26 + for ; Wed, 18 Apr 2012 08:39:20 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=mime-version:in-reply-to:references:date:message-id:subject:from:to + :cc:content-type; + bh=et3K0CKuN0W1n+5jho3NmikhnS9RrMxhw4NImYybndE=; + b=FJJMVgdJ9Ge/ukIuHX+AnOch+wGkCGGbLfSydmWeIBEzhJNSxCL8WEQDklZOFpC6u+ + htEoNdSJP2I57+zWMBWmpzzVX4mlQsdNbsqeuO6Kf/wFduGR8zvw7MMJdqt+vmMhdtab + 0vZkGpehkPxnCwQHECGQInLUoAjK3frfSixctFod79GgI0dRCA7s3ih5yz8uf2DxVMCQ + JyHeLyjIBNaJzkqp3rU0GS4uFRHqjAwoAfywrTo+t8nWSVKRZoxFg0gWSPuXlFTysfkV + I2/pQ9vbVY5uJtPYLB6OwDNNRkhOO4jFnFoCgLR/p2Qw0t6Fx8W8vguO9Y0O4gUznIHY + KpyQ== +MIME-Version: 1.0 +Received: by 10.213.104.132 with SMTP id p4mr252938ebo.101.1334763560806; Wed, + 18 Apr 2012 08:39:20 -0700 (PDT) +Received: by 10.213.19.67 with HTTP; Wed, 18 Apr 2012 08:39:20 -0700 (PDT) +In-Reply-To: <87vckxazq7.fsf@nikula.org> +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> +Date: Wed, 18 Apr 2012 18:39:20 +0300 +Message-ID: + +Subject: Re: [PATCH v2 1/3] Add 'compose' command +From: Felipe Contreras +To: Jani Nikula +Content-Type: text/plain; charset=UTF-8 +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 15:39:26 -0000 + +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". + +> 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