unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH 10/21] vim: generate custom message-id
Date: Sat,  2 Nov 2013 07:55:43 -0600	[thread overview]
Message-ID: <1383400554-1832-11-git-send-email-felipe.contreras@gmail.com> (raw)
In-Reply-To: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com>

Using Mail as a reference.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 vim/notmuch.vim | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 4bd5f13..64038eb 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -421,6 +421,7 @@ ruby << EOF
 	require 'notmuch'
 	require 'rubygems'
 	require 'tempfile'
+	require 'socket'
 	begin
 		require 'mail'
 	rescue LoadError
@@ -492,6 +493,14 @@ ruby << EOF
 		end
 	end
 
+	def generate_message_id
+		t = Time.now
+		random_tag = sprintf('%x%x_%x%x%x',
+			t.to_i, t.tv_usec,
+			$$, Thread.current.object_id.abs, rand(255))
+		return "<#{random_tag}@#{Socket.gethostname}.notmuch>"
+	end
+
 	def open_reply(orig)
 		help_lines = [
 			'Notmuch-Help: Type in your message here; to help you use these bindings:',
@@ -505,6 +514,7 @@ ruby << EOF
 			end
 			m.cc = orig[:cc]
 			m.from = $email
+			m.message_id = generate_message_id
 			m.charset = 'utf-8'
 			m.content_transfer_encoding = '7bit'
 		end
-- 
1.8.4.2+fc1

  parent reply	other threads:[~2013-11-02 14:03 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-02 13:55 [PATCH 00/21] vim: general updates Felipe Contreras
2013-11-02 13:55 ` [PATCH 01/21] vim: run mutt in default term Felipe Contreras
2013-11-02 13:55 ` [PATCH 02/21] vim: don't automatically refresh after tagging Felipe Contreras
2013-11-02 13:55 ` [PATCH 03/21] vim: use notmuch fields Felipe Contreras
2013-11-02 13:55 ` [PATCH 04/21] vim: refactor database handling Felipe Contreras
2013-11-02 13:55 ` [PATCH 05/21] vim: show first message of the thread Felipe Contreras
2013-11-02 13:55 ` [PATCH 06/21] vim: use much clearer sort constant Felipe Contreras
2013-11-02 13:55 ` [PATCH 07/21] vim: add option to save the patches of a patch series Felipe Contreras
2013-11-02 13:55 ` [PATCH 08/21] vim: allow calling with arguments Felipe Contreras
2013-11-02 13:55 ` [PATCH 09/21] vim: split $email_address Felipe Contreras
2013-11-02 13:55 ` Felipe Contreras [this message]
2013-11-02 13:55 ` [PATCH 11/21] vim: don't execute search if it's cancelled Felipe Contreras
2013-11-02 13:55 ` [PATCH 12/21] vim: trivial cleanup Felipe Contreras
2013-11-02 13:55 ` [PATCH 13/21] vim: refactor open_reply() Felipe Contreras
2013-11-02 13:55 ` [PATCH 14/21] vim: add option to compose new messages Felipe Contreras
2013-11-02 13:55 ` [PATCH 15/21] vim: rename internal notmuch_rb variables Felipe Contreras
2013-11-02 13:55 ` [PATCH 16/21] vim: rename public " Felipe Contreras
2013-11-02 13:55 ` [PATCH 17/21] vim: move default sets to set_defaults() Felipe Contreras
2013-11-02 13:55 ` [PATCH 18/21] vim: add wrapper for old variable names Felipe Contreras
2013-11-02 13:55 ` [PATCH 19/21] vim: remove unnecessary buffer queue Felipe Contreras
2013-11-02 13:55 ` [PATCH 20/21] vim: check compose is done on delete Felipe Contreras
2013-11-02 13:55 ` [PATCH 21/21] vim: add help file Felipe Contreras
2013-11-08 12:43   ` David Bremner
2013-11-08 13:10     ` Felipe Contreras
2013-11-08 18:03       ` David Bremner
2013-11-08 18:05         ` Felipe Contreras
2013-11-09  0:08           ` David Bremner
2013-11-11 18:11 ` [PATCH 00/21] vim: general updates Felipe Contreras
2013-11-20 12:21   ` David Bremner
2013-11-20 13:31     ` Felipe Contreras
2013-11-20 22:13       ` David Bremner
2013-11-27  6:35         ` Felipe Contreras
2013-11-28 10:26           ` [PATCH] vim: NEWS for vim interface David Bremner
2013-11-29  7:54             ` Tomi Ollila
2013-11-29 11:58             ` David Bremner

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=1383400554-1832-11-git-send-email-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.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).