From: Felipe Contreras Date: Sat, 2 Nov 2013 13:55:43 +0000 (+1800) Subject: [PATCH 10/21] vim: generate custom message-id X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=042d3a227b3f6ec971e44c086dd0e9f0f35f94a3;p=notmuch-archives.git [PATCH 10/21] vim: generate custom message-id --- diff --git a/c6/cfd8081cc28692c88dee1a16a1a2eb343243ca b/c6/cfd8081cc28692c88dee1a16a1a2eb343243ca new file mode 100644 index 000000000..eaa9551e6 --- /dev/null +++ b/c6/cfd8081cc28692c88dee1a16a1a2eb343243ca @@ -0,0 +1,107 @@ +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 4D4FE429E53 + for ; Sat, 2 Nov 2013 07:03:47 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, 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 8WQOvKeyWKsb for ; + Sat, 2 Nov 2013 07:03:41 -0700 (PDT) +Received: from mail-ob0-f176.google.com (mail-ob0-f176.google.com + [209.85.214.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 7A275431FAF + for ; Sat, 2 Nov 2013 07:03:02 -0700 (PDT) +Received: by mail-ob0-f176.google.com with SMTP id uy5so5633880obc.35 + for ; Sat, 02 Nov 2013 07:03:02 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=hhwDFSUzsVKmFb/fQox8fdeILLYTemd1dKkm5DGyexQ=; + b=sXIRPN9c900DxV7eG9SjbNPVSc+jz0QaHU7kL/Mbb3mZJTjBFpcVKpYq09JqDM97Pj + A+jjsHYf+2vWHM2Yr/dEq9Ypripax5aDzXJYLQYcMr6vqeHl1NOoKdgZ6aBjCUdhZzPo + 6MYf6MHkO6UTpUfNNsHW0HoYrfnggByAkjeGt+Iwe9x3Iy13yrAisoqkaskMn4hammza + 1dk2Jbv58H8r4zRe7Rgk3eI9+H6+oe3S8O9GbTECY74ttUIL7vIue3utCM6w4SEcpZIA + N9gZNga92P+swEXpGBBHJG8mDunkEWkbqgyy2eO6pCOTspPbFazxAaqZDrfrUtm9PGBY + mo4w== +X-Received: by 10.60.62.101 with SMTP id x5mr6457971oer.24.1383400981982; + Sat, 02 Nov 2013 07:03:01 -0700 (PDT) +Received: from localhost (187-162-140-241.static.axtel.net. [187.162.140.241]) + by mx.google.com with ESMTPSA id + rl1sm24741590oeb.7.2013.11.02.07.03.00 for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sat, 02 Nov 2013 07:03:01 -0700 (PDT) +From: Felipe Contreras +To: notmuch@notmuchmail.org +Subject: [PATCH 10/21] vim: generate custom message-id +Date: Sat, 2 Nov 2013 07:55:43 -0600 +Message-Id: <1383400554-1832-11-git-send-email-felipe.contreras@gmail.com> +X-Mailer: git-send-email 1.8.4.2+fc1 +In-Reply-To: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com> +References: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com> +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: Sat, 02 Nov 2013 14:03:47 -0000 + +Using Mail as a reference. + +Signed-off-by: Felipe Contreras +--- + 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 +