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 B381F429E2A for ; Sun, 6 Feb 2011 05:29:19 -0800 (PST) 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 2jYLVPc9kae8 for ; Sun, 6 Feb 2011 05:29:18 -0800 (PST) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E4236429E21 for ; Sun, 6 Feb 2011 05:29:15 -0800 (PST) Received: by mail-fx0-f53.google.com with SMTP id 11so4326160fxm.26 for ; Sun, 06 Feb 2011 05:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=Jgpb9no4joNKLYErn59+ka/01UoS2reOi2E2ijI1icE=; b=p96dXq9E/0bC/3zZsy2HrEB/3P9GCPCoap8fHdVjssN2iwU+snake8UoQJEbY60WiN g5nmdxrancAnWxAqRwgz+D0SBGA+PVVR5Ov09pYGAIH4IdtBhMj/wdPzYp1B7lwuNDiI 9r+0dGnAsTgXF0xg/2rWBxKo2MuOrKeEke1FA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=qyCYApGrnW0SS5n3BeM/thlhqtTgdK5f97bBCIZTMaHeFaA0ZHNku690/CKNsFDZn1 o0v1jxtX3A02g1n/cQVzSSArSOqwSNQ9CNdsWncHslnnxDZb933jRI0gsb98jDg9nrnq WeOJhsO0l5wT/hELSEunEwl6kqPeK8gnGXQbA= Received: by 10.223.96.66 with SMTP id g2mr5594279fan.61.1296998955561; Sun, 06 Feb 2011 05:29:15 -0800 (PST) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id l3sm561284fan.2.2011.02.06.05.29.14 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Feb 2011 05:29:15 -0800 (PST) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 2/2] vim: parse 'from' address Date: Sun, 6 Feb 2011 15:29:07 +0200 Message-Id: <1296998947-13683-3-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.4.1.g4f7e4.dirty In-Reply-To: <1296998947-13683-1-git-send-email-felipe.contreras@gmail.com> References: <1296998947-13683-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: Sun, 06 Feb 2011 13:29:20 -0000 In order to pass it to sendmail. Signed-off-by: Felipe Contreras --- vim/plugin/notmuch.vim | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 002b771..08832cc 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -961,7 +961,16 @@ function! s:NM_compose_send() exec printf(':0,%dd', hdr_starts) write - let cmdtxt = g:notmuch_sendmail . ' -t < ' . fname + let line = getline(1) + let m = matchlist(line, '^From:\s*\(.*\)\s*<\(.*\)>$') + if (len(m) >= 2) + let from = m[2] + else + let m = matchlist(line, '^From:\s*\(.*\)$') + let from = m[1] + endif + + let cmdtxt = g:notmuch_sendmail . ' -t -f ' . from . ' < ' . fname let out = system(cmdtxt) let err = v:shell_error if err -- 1.7.4.1.g4f7e4.dirty