From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/51265 Path: main.gmane.org!not-for-mail From: deskpot@despammed.com (Vasily Korytov) Newsgroups: gmane.emacs.gnus.general Subject: Re: secure method Date: Tue, 08 Apr 2003 02:58:15 +0400 Sender: owner-ding@hpc.uh.edu Message-ID: <87of3hj4oo.fsf@unix.home> References: <84znn2jsb9.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: main.gmane.org 1049756373 26469 80.91.224.249 (7 Apr 2003 22:59:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2003 22:59:33 +0000 (UTC) Original-X-From: owner-ding@hpc.uh.edu Tue Apr 08 00:59:30 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 192faM-0006sa-00 for ; Tue, 08 Apr 2003 00:59:30 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 192faB-0006w9-00; Mon, 07 Apr 2003 17:59:19 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 07 Apr 2003 18:00:23 -0500 (CDT) Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id SAA03670 for ; Mon, 7 Apr 2003 18:00:10 -0500 (CDT) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 192fZS-0006p3-00 for ; Tue, 08 Apr 2003 00:58:34 +0200 Mail-Followup-To: ding@hpc.uh.edu X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@hpc.uh.edu Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 192fZR-0006ou-00 for ; Tue, 08 Apr 2003 00:58:33 +0200 Original-Lines: 84 Original-X-Complaints-To: usenet@main.gmane.org Mail-Copies-To: never User-Agent: Gnus/5.090018 (Oort Gnus v0.18) XEmacs/21.4 (Portable Code) Cancel-Lock: sha1:1yPTIgJo2Vcq9cS7exmT/YOcTUE= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:51265 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:51265 --=-=-= Content-Transfer-Encoding: quoted-printable 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=3Dpgpmime mode=3Dsign> > > 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-pgpmi= me)) (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=3D (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=3D (substring groups 0 6) "fido7."))) ; t)))) (defun mml-vk-remove-broken-sign () "Remove a \"^<\#secure method=3Dpgpmime mode=3Dsign>$\" below the first l= ine of the message body." (interactive) (save-excursion (message-goto-body) (forward-line) (when (search-forward-regexp "^<\#secure method=3Dpgpmime mode=3Dsign>$= " nil t) (delete-region (point-at-bol) (point-at-eol)) (unless (eq (point) (point-max)) (delete-char))))) =2D-=20 I accept RFC3156 and RFC2440-compatible encrypted mail. PGP key fingerprint: 123A 7CCE 6E26 6233 0D87 E01A A0F8 3524 FCD8 1841 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+kgKKoPg1JPzYGEERAo/LAJ0adOlBQvUjCxve7M8T3gbbjtzJ/gCgufrs GjxA0S/HpIxu+mQHuMO0mpI= =KNvb -----END PGP SIGNATURE----- --=-=-=--