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 9FB526DE098B for ; Sat, 1 Oct 2016 07:20:24 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.007 X-Spam-Level: X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=0.004, 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 MdIU-d-xmYRJ for ; Sat, 1 Oct 2016 07:20:23 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 33E466DE00CC for ; Sat, 1 Oct 2016 07:20:22 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1bqL97-00008N-4D; Sat, 01 Oct 2016 10:20:09 -0400 Received: (nullmailer pid 23624 invoked by uid 1000); Sat, 01 Oct 2016 14:20:18 -0000 From: David Bremner To: Mark Walters , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] emacs: postpone/resume support In-Reply-To: <1473004582-19396-3-git-send-email-markwalters1009@gmail.com> References: <1473004582-19396-1-git-send-email-markwalters1009@gmail.com> <1473004582-19396-3-git-send-email-markwalters1009@gmail.com> Date: Sat, 01 Oct 2016 11:20:10 -0300 Message-ID: <87bmz4i21x.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" 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, 01 Oct 2016 14:20:24 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Mark Walters writes: > This provides preliminary support for postponing and resuming in the > emacs frontend. On postponing it uses notmuch insert to put the > message in the notmuch database; resume gets the raw file from notmuch > and using the emacs function mime-to-mml reconstructs the message > (including attachments). I was thinking about this a bit more, in the context of your other patch to scan for #secure, and it occured to me one option would be would be to add a header to the draft being written with the secure (and other relevant info). As a proof of concept I added a constant header to all drafts [1]. An outline of the approach would be =2D scan for #secure tags, error if they are not in the right place =2D if found at the top of the document, extract the contents, remove the mml tag and put in a header like e.g. X-Notmuch-Emacs-Secure: method=3Dpgpmime mode=3Dsign =2D on reading back, check for, remove that header, add the corresponding #secure tag. It might be possible to re-use functions e.g. mml-secure-message and mml-unsecure-message from mml-sec.el Compared to the other approach we discussed (using message-properties to store the data), this has the advantage of not requiring new features in the CLI. Also, it would probably be a potential source of user error to sync drafts between machines via some imap/rsync mechanism, without syncing message metadata. Our usual distaste for writing headers is that we don't want to modify delivered mail; this seems a non-issue here to me since there is no delivered mail. Others might disagree, of course. [1] diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 95e5650..412da94 100644 =2D-- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -163,6 +163,7 @@ by notmuch-mua-mail" "Setup message for saving. Should be called on a temporary copy. =20 This is taken from the function message-do-fcc." + (message-add-header "X-Notmuch-Emacs-Draft: true") (message-encode-message-body) (save-restriction (message-narrow-to-headers) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGcBAEBCAAGBQJX78YaAAoJEPIClx2kp54sm98L/2RAPahDYzABbBI6vD2Rufjm yTcuQKaK8LOuxNEEVftDOmWYN9eyVqfid/nmn9U3KV1lFcYxxEVQ7lkmk7Kax2UP hKFLA506vCoRpTU01zXh+vMJuDr3WTpT6NPX118nTB4e1771uk5bzeFpZzE6C7CL ji9KRI1cKZMIQ/IeFY94MPgWg0JLkIj+HcRhiaBJnZdgOmguoYsqWkbl/DrYOKpC 23/LN/bOuDHlinqus+lCgWuJJgxHzJRIigzCkUhjX+JD2Y5XDeJzHdUICUMcIUom hUU5bbd9F8vAp69x/6B2nt3bxZMqU1iKfFcRugklM/kWB+uFKeoFu+twr1FKw+uQ k7dJICGNEo1Tnbhwk0XQKUq5C6vJKD04mMUInoVkUoEofFYHIOR3xTk1fzcD16/g WHMYHLxHdET3bQHTcaiuE9bpnmEuULlN23YqhFWsh49JiFTzMvQFg80WjcpeziGE DC/BmOEfnznNnF3Y8onGpJ5MlC6vQd7q9MLMfiOdTw== =LRdJ -----END PGP SIGNATURE----- --=-=-=--