unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Antoine Beaupré" <anarcat@anarcat.ath.cx>
To: David Edmondson <dme@dme.org>, Gregor Zattler <telegraph@gmx.net>,
	Jameson Graef Rollins <jrollins@finestructure.net>,
	Gregor Zattler <telegraph@gmx.net>,
	Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: Emacs: Crypto: How to get automatic encryption?
Date: Tue, 17 Jan 2012 16:12:37 -0000	[thread overview]
Message-ID: <87sjjewbnw.fsf@marcos.anarcat.ath.cx> (raw)
In-Reply-To: <cunfwfer8i0.fsf@hotblack-desiato.hh.sledj.net>

On Tue, 17 Jan 2012 09:19:51 +0000, David Edmondson <dme@dme.org> wrote:
> On Mon, 16 Jan 2012 23:48:30 -0500, Antoine Beaupré <anarcat@anarcat.ath.cx> wrote:
> > Jumping in here, I have modified the previously posted code here to
> > provide me with a more complete solution.
> 
> This looks good. I'll switch over to using it.

Awesome!

> > Code is attached. Obviously, those function names would change if they
> > would be to integrate into notmuch. ;)
> 
> I wondered about pushing to have notmuch do this by default. In general
> I like the idea, but it suffers if a recipient occasionally uses a mail
> client that does not support decryption (phone, PDA, webmail, ...).

Well, it your call: you can disable encryption on the fly by setting the
message to just signing...

I have also found out (to great pains) that it is kind of difficult to
*completely* disable signing or encrypting, as the send-hook will
happily add back the #secure line even if you remove it.

A workaround is to set "mode=none" in the #secure line manually. Maybe
C-c RET C-n could do that instead of just removing the line?

On Tue, 17 Jan 2012 15:39:52 +0000, David Edmondson <dme@dme.org> wrote:
> >        (if (and force (re-search-forward "<#secure [> >]*>\n" nil t))
> > 	   (replace-match "" nil nil))
> >        ;; If we can encrypt, do so, else just sign.
> >        (if (or force (not (re-search-forward "<#secure [> >]*>\n" nil t)))
> 
> Is this second test for `force' necessary? If `force' is set then you'll
> remove the <#secure..> just above, so it will not be found here.

Yes, it is. If force is true, the search-forward will not be ran at
all. The idea here is that if we do not force (ie. if we're running in
the hook), we do not want to override the existing #secure tags, to
respect the users' choices.

Cheers,

A.

-- 
Antoine Beaupré +++ Réseau Koumbit Networks +++ +1.514.387.6262 #208
--------------------------------------------------------------------

  reply	other threads:[~2012-01-17 16:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03 19:56 Emacs: Crypto: How to get automatic encryption? Gregor Zattler
2012-01-03 21:45 ` Jameson Graef Rollins
2012-01-04  0:08   ` Gregor Zattler
2012-01-04  8:36   ` David Edmondson
2012-01-04  8:48     ` David Edmondson
2012-01-15 22:27       ` Gregor Zattler
2012-01-17  4:48         ` Antoine Beaupré
2012-01-17  9:19           ` David Edmondson
2012-01-17 16:12             ` Antoine Beaupré [this message]
2012-01-24 21:34             ` micah anderson
2012-01-25  0:10               ` Jameson Graef Rollins
2012-01-25  6:23                 ` David Edmondson
2012-01-25  9:26                   ` Jameson Graef Rollins
2012-01-25 10:20                     ` David Edmondson
2012-01-25 17:45                       ` Jameson Graef Rollins
2012-01-25 19:09                         ` Daniel Kahn Gillmor
2012-01-26  8:53                         ` David Edmondson
2012-01-17 15:39           ` David Edmondson
2012-01-12 18:41   ` Jameson Graef Rollins
2012-01-12 19:05     ` Gregor Zattler
2012-01-12 19:28       ` Jameson Graef Rollins
2012-01-12 19:29       ` Darren McGuicken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sjjewbnw.fsf@marcos.anarcat.ath.cx \
    --to=anarcat@anarcat.ath.cx \
    --cc=dme@dme.org \
    --cc=jrollins@finestructure.net \
    --cc=notmuch@notmuchmail.org \
    --cc=telegraph@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).