From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/49416 Path: main.gmane.org!not-for-mail From: Patrice Neff Newsgroups: gmane.emacs.gnus.general Subject: Re: PGG howto ? Date: Tue, 21 Jan 2003 08:22:02 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1043133868 8324 80.91.224.249 (21 Jan 2003 07:24:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 21 Jan 2003 07:24:28 +0000 (UTC) Cc: ding@gnus.org 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 18aslm-0002A8-00 for ; Tue, 21 Jan 2003 08:24:26 +0100 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 18asmW-00049K-00; Tue, 21 Jan 2003 01:25:12 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 21 Jan 2003 01:26:08 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id BAA25584 for ; Tue, 21 Jan 2003 01:25:57 -0600 (CST) Original-Received: (qmail 62666 invoked by alias); 21 Jan 2003 07:24:57 -0000 Original-Received: (qmail 62661 invoked from network); 21 Jan 2003 07:24:57 -0000 Original-Received: from unknown (HELO scorpion.patrice.ch) (195.141.221.138) by 66.230.238.6 with SMTP; 21 Jan 2003 07:24:57 -0000 Original-Received: (qmail 1758 invoked by uid 1000); 21 Jan 2003 07:22:02 -0000 Original-To: Xavier MAILLARD In-Reply-To: (Xavier MAILLARD's message of "Mon, 20 Jan 2003 22:27:07 +0100") User-Agent: Gnus/5.090013 (Oort Gnus v0.13) XEmacs/21.4 (Military Intelligence, i386-debian-linux) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:49416 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:49416 Xavier MAILLARD writes: > So I am :) Please gimme the tricks ;-) Well, dunno about the code quality, but here is the modified function: (defun bbdb/pgp-hook-fun () "Function to be added to message-send-hook Uses PGP to encrypt messages to users marked in the BBDB with the field bbdb-pgp-field." (save-restriction (save-excursion (message-narrow-to-headers) (let* ((to-field (mail-fetch-field "To" nil t)) (address (mail-extract-address-components (or to-field "")))) (widen) (if (not (equal address `(nil nil))) (let ((pgp-p (bbdb/pgp-get-pgp (car address) (car (cdr address))))) (cond ((string= "encrypt" pgp-p) (and (y-or-n-p "Encrypt message ? ") (call-interactively 'mml-secure-encrypt-pgpmime))) ((string= "sign" pgp-p) (and (y-or-n-p "Sign message ? ") (call-interactively 'mml-secure-sign-pgpmime))) (t nil)))))))) Bye Patrice