Re: [PATCH v2 1/3] Add 'compose' command
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Wed, 18 Apr 2012 16:10:47 +0000 (20:10 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:34 +0000 (09:46 -0800)
73/fecaadea71dc95be7e41f6fccdb8f0192ed142 [new file with mode: 0644]

diff --git a/73/fecaadea71dc95be7e41f6fccdb8f0192ed142 b/73/fecaadea71dc95be7e41f6fccdb8f0192ed142
new file mode 100644 (file)
index 0000000..6e0b8cc
--- /dev/null
@@ -0,0 +1,148 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1CC21431FDE\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Apr 2012 09:12:45 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Mr+GXZzoGscf for <notmuch@notmuchmail.org>;\r
+       Wed, 18 Apr 2012 09:12:40 -0700 (PDT)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+       [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 18289431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Apr 2012 09:12:39 -0700 (PDT)\r
+Received: by lahc1 with SMTP id c1so5972279lah.26\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Apr 2012 09:12:38 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type;\r
+       bh=Ir5wpoHOAT67wPEe+M73vBy98rn4prhCvDOSpvdsgBE=;\r
+       b=aJfwht5C2XRYE5/PcQRzou47F00SY8vITCqJMNci0mfJdTapX8eMT8QOS6qjQm7t0y\r
+       pMhH9uGidIZivsvHnjC/cDMe3rjQ/TGrIpFcCjZAIiZmaN2FiKs69gASmkv5m2lh5dRI\r
+       IaT0yTix63xatiZ3F4zgA67WCx2jmj6YEjbhBxd6NG+6ElEGNOOuqZMWGPFQ/6iJuQaw\r
+       pA5hYYdecK4qDX9UPco7bswBgM1vsUONjNbF8zmDZ0lqkyeN93RwQkHQldomGUocdS2e\r
+       mnRd73LBVd3YLyV9KTaeI2plMG+Ofd3rDgJa+w2J4fdVASjiNSUSYrJ4p7J8fNkS5E7K\r
+       APrg==\r
+Received: by 10.112.42.100 with SMTP id n4mr1307250lbl.90.1334765558362;\r
+       Wed, 18 Apr 2012 09:12:38 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id mr15sm26721812lab.8.2012.04.18.09.12.37\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 18 Apr 2012 09:12:37 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>,\r
+       Felipe Contreras <felipe.contreras@gmail.com>,\r
+       Jani Nikula <jani@nikula.org>\r
+Subject: Re: [PATCH v2 1/3] Add 'compose' command\r
+In-Reply-To: <m21unlc9np.fsf@guru.guru-group.fi>\r
+References: <1334752753-23970-1-git-send-email-felipe.contreras@gmail.com>\r
+       <1334752753-23970-2-git-send-email-felipe.contreras@gmail.com>\r
+       <873981chpj.fsf@nikula.org>\r
+       <CAMP44s2Ukz=kDaPHYG+jzR3pDfZGP+6Ojqc4Xz5J8PxEd9fKcQ@mail.gmail.com>\r
+       <87vckxazq7.fsf@nikula.org>\r
+       <CAMP44s1117VXAOnURjFAeva93oiJsKKPji4awN_SoNFo0QvPPw@mail.gmail.com>\r
+       <m21unlc9np.fsf@guru.guru-group.fi>\r
+User-Agent: Notmuch/0.12+104~gf9ad237 (http://notmuchmail.org) Emacs/23.4.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 18 Apr 2012 20:10:47 +0400\r
+Message-ID: <87ty0hkol4.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: Felipe Contreras <felipe.contreras@ngmail.com>, notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 18 Apr 2012 16:12:45 -0000\r
+\r
+Tomi Ollila <tomi.ollila@iki.fi> writes:\r
+\r
+> On Wed, Apr 18 2012, Felipe Contreras <felipe.contreras@gmail.com> wrote:\r
+>\r
+>> On Wed, Apr 18, 2012 at 5:20 PM, Jani Nikula <jani@nikula.org> wrote:\r
+>>> On Wed, 18 Apr 2012 16:34:30 +0300, Felipe Contreras <felipe.contreras@gmail.com> wrote:\r
+>>>> On Wed, Apr 18, 2012 at 4:06 PM, Jani Nikula <jani@nikula.org> wrote:\r
+>>>>\r
+>>>> > Running "notmuch compose" more than once within a second would result in\r
+>>>> > identical message ids for the messages, which is not a good idea. That's\r
+>>>> > not likely in interactive use, but the notmuch cli is highly scriptable,\r
+>>>> > so someone is bound to hit this.\r
+>>>> >\r
+>>>> > Some paranoid might also be worried about "leaking" the time you run\r
+>>>> > "notmuch compose"... which may be different from the actual time you\r
+>>>> > send the message.\r
+>>>>\r
+>>>> It's still better than the current situation; nothing. In any case,\r
+>>>> people that have not needed this would not be affected; their UI would\r
+>>>> override the Message-ID.\r
+>>>>\r
+>>>> So do you have a better suggestion for a Message-ID?\r
+>>>\r
+>>> The easy way would be to just use g_mime_utils_generate_message_id()\r
+>>> [1]. It doesn't give you any control of the part before @, but I'm not\r
+>>> sure if that really matters.\r
+>>\r
+>> This is what gmime does:\r
+>> g_strdup_printf ("%lu.%lu.%lu@%s", (unsigned long int) time (NULL),\r
+>> (unsigned long int) getpid (), count++, fqdn);\r
+>>\r
+>> Which actually has some of the issues you mentioned.\r
+>>\r
+>> I can do the same if you want (add pid and count). The advantage of\r
+>> using our own format is that not only would it be more unique, but it\r
+>> would not have "@fqdn".\r
+>\r
+> getpid() is good. I guess count is useless (always one). Now some ideas\r
+> how to obfuscate time(NULL) (nonce + hash (crc32 good enough?) ?\r
+>\r
+\r
+I think the best would be for notmuch to use the gmime function and\r
+change gmime (open a bug, may be provide a patch) to follow the best\r
+practice for Message-ID generation (I guess that would be the document\r
+pointed by Jani [1]).\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+[1] http://www.jwz.org/doc/mid.html\r
+\r
+> Tomi\r
+>\r
+>>\r
+>>> Alternatively you can write your own according to e.g. [2]. Glib appears\r
+>>> to have decent and portable support for pseudo random number\r
+>>> generation. But why bother? I'd go with gmime.\r
+>>\r
+>> But gmime doesn't have anything random. I would actually prefer to\r
+>> have something random though.\r
+>\r
+>\r
+>\r
+>>\r
+>> -- \r
+>> Felipe Contreras\r
+>> _______________________________________________\r
+>> notmuch mailing list\r
+>> notmuch@notmuchmail.org\r
+>> http://notmuchmail.org/mailman/listinfo/notmuch\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r