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 DBB44431FB6 for ; Wed, 18 Apr 2012 09:34:37 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 UDnd5c0jKyVl for ; Wed, 18 Apr 2012 09:34:34 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A27C9431FAE for ; Wed, 18 Apr 2012 09:34:33 -0700 (PDT) Received: by lbdb5 with SMTP id b5so2993419lbd.26 for ; Wed, 18 Apr 2012 09:34:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type:x-gm-message-state; bh=9Iay26iF4wL+ZkMR1Kk1up88VTXGOQagLF3fZyCLUqc=; b=QNDDgZ0AVQ3qAYwWICb7CP9lN+C1ZjEPHnf5247H+KTbpLK9ZtQ6wNAvBbgysDmD5T XHdMAF3z0lAUoX8UZHOArsv86L9QjQpM1Eh3DYSvJL9OJZCo5B1BuOFiaGqU1qM+c2LT vGq8kzMOEp9VP9A17b8RVCj/ankTb8vMaG4yGVL0s87ynvNeICPVmdwmOprA/hvUfNIh MWFrB7vQ9xJVJFIuPXYtMl7HiZ6TnkwxhVyO5HdBbXGSCE9Pn9sFRkoTF8RCUb97GMle YM/XcWUjcOqWmw9urXhE1gADXmK7OBzlJxRXYi4AnA9OTlkySN56i/Au06XSSYSPuUzP 2Y7g== Received: by 10.112.45.98 with SMTP id l2mr1324337lbm.63.1334766871962; Wed, 18 Apr 2012 09:34:31 -0700 (PDT) Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi. [80.220.80.68]) by mx.google.com with ESMTPS id o2sm8054912lbd.7.2012.04.18.09.34.28 (version=SSLv3 cipher=OTHER); Wed, 18 Apr 2012 09:34:30 -0700 (PDT) From: Jani Nikula To: Felipe Contreras 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+81~g839a805 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) Date: Wed, 18 Apr 2012 19:34:26 +0300 Message-ID: <8739819ey5.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQk1jOR48RtqX7gbVwldsA8/UPwho5wIK8OczLItcuJjUwmJkhHNXxlGjVKD3tyKKIUHoffL 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:34:38 -0000 On Wed, 18 Apr 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. Thanks for looking into gmime source. The implementation is a bit of a disappointment. > 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". I'm starting to think doing our own would be the best, although I wouldn't object to using the gmime implementation "for now". >> 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. Agreed. BR, Jani.