[PATCH 10/21] vim: generate custom message-id
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 2 Nov 2013 13:55:43 +0000 (07:55 +1800)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:54 +0000 (09:57 -0800)
c6/cfd8081cc28692c88dee1a16a1a2eb343243ca [new file with mode: 0644]

diff --git a/c6/cfd8081cc28692c88dee1a16a1a2eb343243ca b/c6/cfd8081cc28692c88dee1a16a1a2eb343243ca
new file mode 100644 (file)
index 0000000..eaa9551
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <felipe.contreras@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 4D4FE429E53\r
+       for <notmuch@notmuchmail.org>; Sat,  2 Nov 2013 07:03:47 -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 8WQOvKeyWKsb for <notmuch@notmuchmail.org>;\r
+       Sat,  2 Nov 2013 07:03:41 -0700 (PDT)\r
+Received: from mail-ob0-f176.google.com (mail-ob0-f176.google.com\r
+       [209.85.214.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 7A275431FAF\r
+       for <notmuch@notmuchmail.org>; Sat,  2 Nov 2013 07:03:02 -0700 (PDT)\r
+Received: by mail-ob0-f176.google.com with SMTP id uy5so5633880obc.35\r
+       for <notmuch@notmuchmail.org>; Sat, 02 Nov 2013 07:03:02 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=hhwDFSUzsVKmFb/fQox8fdeILLYTemd1dKkm5DGyexQ=;\r
+       b=sXIRPN9c900DxV7eG9SjbNPVSc+jz0QaHU7kL/Mbb3mZJTjBFpcVKpYq09JqDM97Pj\r
+       A+jjsHYf+2vWHM2Yr/dEq9Ypripax5aDzXJYLQYcMr6vqeHl1NOoKdgZ6aBjCUdhZzPo\r
+       6MYf6MHkO6UTpUfNNsHW0HoYrfnggByAkjeGt+Iwe9x3Iy13yrAisoqkaskMn4hammza\r
+       1dk2Jbv58H8r4zRe7Rgk3eI9+H6+oe3S8O9GbTECY74ttUIL7vIue3utCM6w4SEcpZIA\r
+       N9gZNga92P+swEXpGBBHJG8mDunkEWkbqgyy2eO6pCOTspPbFazxAaqZDrfrUtm9PGBY\r
+       mo4w==\r
+X-Received: by 10.60.62.101 with SMTP id x5mr6457971oer.24.1383400981982;\r
+       Sat, 02 Nov 2013 07:03:01 -0700 (PDT)\r
+Received: from localhost (187-162-140-241.static.axtel.net. [187.162.140.241])\r
+       by mx.google.com with ESMTPSA id\r
+       rl1sm24741590oeb.7.2013.11.02.07.03.00 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Sat, 02 Nov 2013 07:03:01 -0700 (PDT)\r
+From: Felipe Contreras <felipe.contreras@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 10/21] vim: generate custom message-id\r
+Date: Sat,  2 Nov 2013 07:55:43 -0600\r
+Message-Id: <1383400554-1832-11-git-send-email-felipe.contreras@gmail.com>\r
+X-Mailer: git-send-email 1.8.4.2+fc1\r
+In-Reply-To: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com>\r
+References: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com>\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: Sat, 02 Nov 2013 14:03:47 -0000\r
+\r
+Using Mail as a reference.\r
+\r
+Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+---\r
+ vim/notmuch.vim | 10 ++++++++++\r
+ 1 file changed, 10 insertions(+)\r
+\r
+diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+index 4bd5f13..64038eb 100644\r
+--- a/vim/notmuch.vim\r
++++ b/vim/notmuch.vim\r
+@@ -421,6 +421,7 @@ ruby << EOF\r
+       require 'notmuch'\r
+       require 'rubygems'\r
+       require 'tempfile'\r
++      require 'socket'\r
+       begin\r
+               require 'mail'\r
+       rescue LoadError\r
+@@ -492,6 +493,14 @@ ruby << EOF\r
+               end\r
+       end\r
\r
++      def generate_message_id\r
++              t = Time.now\r
++              random_tag = sprintf('%x%x_%x%x%x',\r
++                      t.to_i, t.tv_usec,\r
++                      $$, Thread.current.object_id.abs, rand(255))\r
++              return "<#{random_tag}@#{Socket.gethostname}.notmuch>"\r
++      end\r
++\r
+       def open_reply(orig)\r
+               help_lines = [\r
+                       'Notmuch-Help: Type in your message here; to help you use these bindings:',\r
+@@ -505,6 +514,7 @@ ruby << EOF\r
+                       end\r
+                       m.cc = orig[:cc]\r
+                       m.from = $email\r
++                      m.message_id = generate_message_id\r
+                       m.charset = 'utf-8'\r
+                       m.content_transfer_encoding = '7bit'\r
+               end\r
+-- \r
+1.8.4.2+fc1\r
+\r