From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E37F06DE12A7 for ; Sat, 8 Oct 2016 07:57:48 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.006 X-Spam-Level: X-Spam-Status: No, score=-0.006 tagged_above=-999 required=5 tests=[AWL=0.005, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z0hN4Tnby4JX for ; Sat, 8 Oct 2016 07:57:47 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 27B226DE129E for ; Sat, 8 Oct 2016 07:57:47 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1bst47-0004dR-5u; Sat, 08 Oct 2016 10:57:31 -0400 Received: (nullmailer pid 29128 invoked by uid 1000); Sat, 08 Oct 2016 14:57:43 -0000 From: David Bremner To: Mark Walters , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] emacs: mua: check for misplaced secure mml tags In-Reply-To: <1475417131-24915-3-git-send-email-markwalters1009@gmail.com> References: <1475417131-24915-1-git-send-email-markwalters1009@gmail.com> <1475417131-24915-3-git-send-email-markwalters1009@gmail.com> Date: Sat, 08 Oct 2016 11:57:43 -0300 Message-ID: <878ttyanx4.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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, 08 Oct 2016 14:57:49 -0000 Mark Walters writes: > + (save-excursion > + (let ((body-start (progn (message-goto-body) (point)))) > + (goto-char (point-max)) > + ;; We are always fine if there is no secure tag. > + (when (search-backward "<#secure" nil 't) > + ;; There is a secure tag, so it must be at the start of the > + ;; body, with no secure tag earlier (i.e., in the headers) and > + ;; it must be followed by a newline. > + (unless (and (= (point) body-start) > + (not (search-backward "<#secure" nil 't)) > + (looking-at "<#secure[^\n>]*>\n")) I believe the tag is actually "#secure" not "#!secure" > + (not (yes-or-no-p "\ > +There is a <#secure> tag not at the start of the body. It is > +likely that the message will be sent unsigned and unencrypted. > +Really send? "))))))) > + This is message is a bit misleading if tag is at the begining of the body but is not followed by a newline d