unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Felipe Contreras <felipe.contreras@ngmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH v2 1/3] Add 'compose' command
Date: Wed, 18 Apr 2012 19:34:26 +0300	[thread overview]
Message-ID: <8739819ey5.fsf@nikula.org> (raw)
In-Reply-To: <CAMP44s1117VXAOnURjFAeva93oiJsKKPji4awN_SoNFo0QvPPw@mail.gmail.com>

On Wed, 18 Apr 2012, Felipe Contreras <felipe.contreras@gmail.com> wrote:
> On Wed, Apr 18, 2012 at 5:20 PM, Jani Nikula <jani@nikula.org> wrote:
>> On Wed, 18 Apr 2012 16:34:30 +0300, Felipe Contreras <felipe.contreras@gmail.com> wrote:
>>> On Wed, Apr 18, 2012 at 4:06 PM, Jani Nikula <jani@nikula.org> 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.

  parent reply	other threads:[~2012-04-18 16:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 12:39 [PATCH v2 0/3] composing patches Felipe Contreras
2012-04-18 12:39 ` [PATCH v2 1/3] Add 'compose' command Felipe Contreras
2012-04-18 13:06   ` Jani Nikula
2012-04-18 13:34     ` Felipe Contreras
2012-04-18 13:43       ` Dmitry Kurochkin
2012-04-18 14:11         ` Felipe Contreras
2012-04-18 14:41           ` Dmitry Kurochkin
2012-04-18 15:45             ` Felipe Contreras
2012-04-18 14:20       ` Jani Nikula
2012-04-18 15:39         ` Felipe Contreras
2012-04-18 16:00           ` Tomi Ollila
2012-04-18 16:10             ` Dmitry Kurochkin
2012-04-18 16:34           ` Jani Nikula [this message]
2012-04-19  9:31             ` Tomi Ollila
2012-04-19 14:03               ` Felipe Contreras
2012-04-18 12:39 ` [PATCH v2 2/3] reply: add message-id header Felipe Contreras
2012-04-18 13:09   ` Jani Nikula
2012-04-18 17:27     ` Adam Wolfe Gordon
2012-04-18 19:44     ` Felipe Contreras
2012-04-18 12:39 ` [PATCH v2 3/3] reply: add user-agent field Felipe Contreras
2012-04-18 17:36 ` [PATCH v2 0/3] composing patches Adam Wolfe Gordon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8739819ey5.fsf@nikula.org \
    --to=jani@nikula.org \
    --cc=felipe.contreras@gmail.com \
    --cc=felipe.contreras@ngmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).