Gnus development mailing list
 help / color / mirror / Atom feed
* Yet another attempt at more signing
@ 2002-03-27 13:47 Jack Twilley
  2002-03-27 17:49 ` Simon Josefsson
  0 siblings, 1 reply; 10+ messages in thread
From: Jack Twilley @ 2002-03-27 13:47 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

I got annoyed with having <#secure ...> as the first line of my
messages so I went looking for another arrangement.

Here's what I came up with:

--begin elisp--
(load "bbdb-pgp" t)

(setq bbdb/pgp-default-action 'sign)

(remove-hook 'message-send-hook 'bbdb/pgp-hook-fun)

(add-hook 'message-send-mail-hook 'bbdb/pgp-hook-fun)
(add-hook 'message-send-news-hook '(lambda ()
				     (if (not (string= "one.particular.newsgroup" gnus-newsgroup-name))
					 'mml-secure-message-sign-pgpmime)))
--end elisp--

What that should do is sign all emails I send that aren't to people
who have BBDB entries with "pgp-mail" set to encrypt, and sign all
Usenet posts except those to one particular newsgroup.

Unfortunately, it doesn't work.  I get the error message 
"The message is corrupted. No mail header separator." when trying to
run the mml-secure-message-sign-pgpmime function in the
message-send-news-hook.

Any suggestions?  It would rock if I could somehow stick that
one.particular.newsgroup in a BBDB record and set its "pgp-mail" value
to nil, but I don't think that'd work. :-)

Jack.
-- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash

[-- Attachment #2: Type: application/pgp-signature, Size: 229 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-27 13:47 Yet another attempt at more signing Jack Twilley
@ 2002-03-27 17:49 ` Simon Josefsson
  2002-03-28  0:09   ` Jack Twilley
  2002-03-28  0:12   ` Paul Jarc
  0 siblings, 2 replies; 10+ messages in thread
From: Simon Josefsson @ 2002-03-27 17:49 UTC (permalink / raw)


Jack Twilley <jmt+usenet@twilley.org> writes:

> What that should do is sign all emails I send that aren't to people
> who have BBDB entries with "pgp-mail" set to encrypt, and sign all
> Usenet posts except those to one particular newsgroup.
>
> Unfortunately, it doesn't work.  I get the error message 
> "The message is corrupted. No mail header separator." when trying to
> run the mml-secure-message-sign-pgpmime function in the
> message-send-news-hook.
>
> Any suggestions?  It would rock if I could somehow stick that
> one.particular.newsgroup in a BBDB record and set its "pgp-mail" value
> to nil, but I don't think that'd work. :-)

You need to run the hook before the --text follows this line-- stuff
is replaced with a empty line.  Perhaps you could put a invisible text
property on the MML tag if you don't want to see it...




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-27 17:49 ` Simon Josefsson
@ 2002-03-28  0:09   ` Jack Twilley
  2002-03-28  0:12   ` Paul Jarc
  1 sibling, 0 replies; 10+ messages in thread
From: Jack Twilley @ 2002-03-28  0:09 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]

>>>>> "Simon" == Simon Josefsson <jas@extundo.com> writes:

Jack> What that should do is sign all emails I send that aren't to
Jack> people who have BBDB entries with "pgp-mail" set to encrypt, and
Jack> sign all Usenet posts except those to one particular newsgroup.

Jack> Unfortunately, it doesn't work.  I get the error message "The
Jack> message is corrupted. No mail header separator." when trying to
Jack> run the mml-secure-message-sign-pgpmime function in the
Jack> message-send-news-hook.

Jack> Any suggestions?  It would rock if I could somehow stick that
Jack> one.particular.newsgroup in a BBDB record and set its "pgp-mail"
Jack> value to nil, but I don't think that'd work. :-)

Simon> You need to run the hook before the --text follows this line--
Simon> stuff is replaced with a empty line.  Perhaps you could put a
Simon> invisible text property on the MML tag if you don't want to see
Simon> it...

Is there a hook that occurs after C-c C-c but before the separator
disappears?  Or would it be better just to directly call whatever is
called when that tag is seen?  Would that also solve the problem of
entering in my pass-phrase twice -- once for the original destination,
and once for Gcc?  Will making the line invisible prevent fill-adapt
(or whatever fills when you hit M-q) from filling that line?

Jack.
(full of questions!)
-- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash

[-- Attachment #2: Type: application/pgp-signature, Size: 229 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-27 17:49 ` Simon Josefsson
  2002-03-28  0:09   ` Jack Twilley
@ 2002-03-28  0:12   ` Paul Jarc
  2002-03-28 10:26     ` Simon Josefsson
  1 sibling, 1 reply; 10+ messages in thread
From: Paul Jarc @ 2002-03-28  0:12 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> wrote:
> You need to run the hook before the --text follows this line-- stuff
> is replaced with a empty line.

Not that I've paid close attention to this thread, but I'd guess this
would also work, assuming you don't care about the cosmetic
difference:
(setq mail-header-separator "")


paul



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-28  0:12   ` Paul Jarc
@ 2002-03-28 10:26     ` Simon Josefsson
  2002-03-28 18:09       ` Simon Josefsson
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Josefsson @ 2002-03-28 10:26 UTC (permalink / raw)
  Cc: ding

On Wed, 27 Mar 2002, Paul Jarc wrote:

> Simon Josefsson <jas@extundo.com> wrote:
> > You need to run the hook before the --text follows this line-- stuff
> > is replaced with a empty line.
> 
> Not that I've paid close attention to this thread, but I'd guess this
> would also work, assuming you don't care about the cosmetic
> difference:
> (setq mail-header-separator "")

IIRC, the code goes to point-max and then searches backwards for the
delimiter.  I have no idea why, but it would break your approach if there
are empty lines in the body.  I guess we should goto point-min and search
forward instead, then you can bind mail-header-separator to "" and things
would just work.  I'll change it tonight, unless someone beats me to it.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-28 10:26     ` Simon Josefsson
@ 2002-03-28 18:09       ` Simon Josefsson
  2002-03-28 19:25         ` Jack Twilley
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Josefsson @ 2002-03-28 18:09 UTC (permalink / raw)
  Cc: ding

Simon Josefsson <jas@extundo.com> writes:

> On Wed, 27 Mar 2002, Paul Jarc wrote:
>
>> Simon Josefsson <jas@extundo.com> wrote:
>> > You need to run the hook before the --text follows this line-- stuff
>> > is replaced with a empty line.
>> 
>> Not that I've paid close attention to this thread, but I'd guess this
>> would also work, assuming you don't care about the cosmetic
>> difference:
>> (setq mail-header-separator "")
>
> IIRC, the code goes to point-max and then searches backwards for the
> delimiter.  I have no idea why, but it would break your approach if there
> are empty lines in the body.  I guess we should goto point-min and search
> forward instead, then you can bind mail-header-separator to "" and things
> would just work.  I'll change it tonight, unless someone beats me to it.

Done.  Perhaps this will work now:

(add-hook 'message-send-news-hook
          (lambda ()
	    (if (not (string= "one.particular.newsgroup" gnus-newsgroup-name))
		(let ((mail-header-separator ""))
		  (mml-secure-message-sign-pgpmime)))))




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-28 18:09       ` Simon Josefsson
@ 2002-03-28 19:25         ` Jack Twilley
  2002-03-28 19:40           ` Jack Twilley
  2002-03-28 19:46           ` Paul Jarc
  0 siblings, 2 replies; 10+ messages in thread
From: Jack Twilley @ 2002-03-28 19:25 UTC (permalink / raw)


<#secure method=pgpmime mode=sign>
If this message is signed, that works.  Yay.

Jack.
-- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-28 19:25         ` Jack Twilley
@ 2002-03-28 19:40           ` Jack Twilley
  2002-03-28 19:46           ` Paul Jarc
  1 sibling, 0 replies; 10+ messages in thread
From: Jack Twilley @ 2002-03-28 19:40 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

It would appear that the addition of the tag is too late in the
process to accomplish the goal.

I will look for whatever function is run when the tag is found and
give that a try.

Jack.
-- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash

[-- Attachment #2: Type: application/pgp-signature, Size: 229 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-28 19:25         ` Jack Twilley
  2002-03-28 19:40           ` Jack Twilley
@ 2002-03-28 19:46           ` Paul Jarc
  2002-03-28 20:56             ` Jack Twilley
  1 sibling, 1 reply; 10+ messages in thread
From: Paul Jarc @ 2002-03-28 19:46 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> wrote:
> Done.  Perhaps this will work now:
>
> (add-hook 'message-send-news-hook
>           (lambda ()
> 	    (if (not (string= "one.particular.newsgroup" gnus-newsgroup-name))
> 		(let ((mail-header-separator ""))
> 		  (mml-secure-message-sign-pgpmime)))))

Jack Twilley <jmt+usenet@twilley.org> wrote:
> <#secure method=pgpmime mode=sign>
> If this message is signed, that works.  Yay.

What about this:
(setq mail-header-separator "")
(add-hook 'message-send-news-hook 'jmt:message-send-news-hook)
(defun jmt:message-send-news-hook ()
  (if (not (string= "one.particular.newsgroup" gnus-newsgroup-name))
      (mml-secure-message-sign-pgpmime)))

(I always give hook functions names so that I can redefine the
function during testing, rather than having to remove the old version
from the hook, which is easy to forget.)


paul



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Yet another attempt at more signing
  2002-03-28 19:46           ` Paul Jarc
@ 2002-03-28 20:56             ` Jack Twilley
  0 siblings, 0 replies; 10+ messages in thread
From: Jack Twilley @ 2002-03-28 20:56 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]

>>>>> "Paul" == Paul Jarc <prj@po.cwru.edu> writes:

[...]

Paul> What about this: (setq mail-header-separator "") (add-hook
Paul> 'message-send-news-hook 'jmt:message-send-news-hook) (defun
Paul> jmt:message-send-news-hook () (if (not (string=
Paul> "one.particular.newsgroup" gnus-newsgroup-name))
Paul> (mml-secure-message-sign-pgpmime)))

The message-send-news-hook is too late to do what I need.  That is
after the time where Gnus checks to see if the tag is there.  All that
function will do at that time is add that line, which isn't helpful.

Paul> (I always give hook functions names so that I can redefine the
Paul> function during testing, rather than having to remove the old
Paul> version from the hook, which is easy to forget.)

A good practice, I agree.  When I'm first tweaking something, I don't
usually do that, though.

Paul> paul

Jack.
(ah, elisp)
-- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash

[-- Attachment #2: Type: application/pgp-signature, Size: 229 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-03-28 20:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-27 13:47 Yet another attempt at more signing Jack Twilley
2002-03-27 17:49 ` Simon Josefsson
2002-03-28  0:09   ` Jack Twilley
2002-03-28  0:12   ` Paul Jarc
2002-03-28 10:26     ` Simon Josefsson
2002-03-28 18:09       ` Simon Josefsson
2002-03-28 19:25         ` Jack Twilley
2002-03-28 19:40           ` Jack Twilley
2002-03-28 19:46           ` Paul Jarc
2002-03-28 20:56             ` Jack Twilley

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 NNTP newsgroup(s).