Gnus development mailing list
 help / color / mirror / Atom feed
From: deskpot@despammed.com (Vasily Korytov)
Subject: Re: secure method
Date: Tue, 08 Apr 2003 02:58:15 +0400	[thread overview]
Message-ID: <87of3hj4oo.fsf@unix.home> (raw)
In-Reply-To: <m3he9aorz6.fsf_-_@avarre.com>

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

On Tue, 08 Apr 2003 00:36:13 +0200, Julien Avarre wrote:

>    (add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime)
>
>
> It allows me to automatically put the pattern in my message :
>
>                   <#secure method=pgpmime mode=sign>
>
> But when I reply  to a message, this pattern is written  at the end of
> quoted text.  Gnus do not interpret  it. I have to move it manually to
> the beginning of the body :-(
>
> Is there a way to avoid that, automatize this ?

Yup. There is gnus-message-setup-hook. Unless, you want to sign not all
the messages, it works. If it's not the case, huge constructions like
this appear:

(add-hook 'message-setup-hook 'mml-vk-maybe-sign)
(add-hook 'gnus-message-setup-hook 'mml-vk-maybe-sign)
(add-hook 'gnus-message-setup-hook 'mml-vk-remove-broken-sign)
(add-hook 'tc-pre-hook 'mml-unsecure-message) ;; or sc-pre-hook, or whatever

;; Should we sign the message
;;
(defun mml-vk-maybe-sign ()
  "Sign the message with PGP/MIME (if mml-vk-maybe-sign-pgpmime is bound
and returns anything, but nil) or PGP (same with mml-vk-maybe-sign-pgp)."
  (interactive)
  (cond ((and (fboundp 'mml-vk-maybe-sign-pgpmime) (mml-vk-maybe-sign-pgpmime))
	 (mml-secure-message-sign-pgpmime))
	((and (fboundp 'mml-vk-maybe-sign-pgp) (mml-vk-maybe-sign-pgp))
	 (mml-secure-message-sign-pgp))))

;; sign all the mail messages (gmane.* newsgroups are mailing lists)
(defun mml-vk-maybe-sign-pgpmime ()
  (cond ((message-mail-p)
	 t)
	((message-news-p)
	 (let ((groups (message-fetch-field "Newsgroups")))
	   (if (and groups (string= (substring groups 0 6) "gmane."))
	       t)))))

;; sign all the news messages, except fido7 hierarchy
;(defun mml-vk-maybe-sign-pgp ()
;  (if (message-news-p)
;      (let ((groups (message-fetch-field "Newsgroups")))
;	(if (and groups (not (string= (substring groups 0 6) "fido7.")))
;	    t))))

(defun mml-vk-remove-broken-sign ()
  "Remove a \"^<\#secure method=pgpmime mode=sign>$\" below the first line
of the message body."
  (interactive)
  (save-excursion
    (message-goto-body)
    (forward-line)
    (when (search-forward-regexp "^<\#secure method=pgpmime mode=sign>$" nil t)
      (delete-region (point-at-bol) (point-at-eol))
      (unless (eq (point) (point-max))
	(delete-char)))))

-- 
       I accept RFC3156 and RFC2440-compatible encrypted mail.
PGP key fingerprint: 123A 7CCE 6E26 6233 0D87 E01A A0F8 3524 FCD8 1841

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

  reply	other threads:[~2003-04-07 22:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-07 13:55 gnus-narrow-to-head, message-narrow-to-body? Reiner Steib
2003-04-07 14:27 ` Kai Großjohann
2003-04-07 14:43   ` Julien Avarre
2003-04-07 15:59     ` Kai Großjohann
2003-04-07 16:33     ` Reiner Steib
2003-04-07 22:36       ` secure method (was: gnus-narrow-to-head, message-narrow-to-body?) Julien Avarre
2003-04-07 22:58         ` Vasily Korytov [this message]
2003-04-08  0:01           ` secure method Julien Avarre
2003-04-08  0:08             ` Julien Avarre

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

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

  git send-email \
    --in-reply-to=87of3hj4oo.fsf@unix.home \
    --to=deskpot@despammed.com \
    /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.
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).