From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/49420 Path: main.gmane.org!not-for-mail From: Xavier MAILLARD Newsgroups: gmane.emacs.gnus.general Subject: Re: PGG howto ? Date: Tue, 21 Jan 2003 10:36:48 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: 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 1043141784 1442 80.91.224.249 (21 Jan 2003 09:36:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 21 Jan 2003 09:36:24 +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 18aupS-0000N8-00 for ; Tue, 21 Jan 2003 10:36:22 +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 18auqY-0004wj-00; Tue, 21 Jan 2003 03:37:30 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 21 Jan 2003 03:38:26 -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 DAA25946 for ; Tue, 21 Jan 2003 03:38:12 -0600 (CST) Original-Received: (qmail 72663 invoked by alias); 21 Jan 2003 09:37:12 -0000 Original-Received: (qmail 72658 invoked from network); 21 Jan 2003 09:37:12 -0000 Original-Received: from rms.gnu-rox.org (HELO smtp.gnu-rox.org) (213.41.134.247) by 66.230.238.6 with SMTP; 21 Jan 2003 09:37:12 -0000 Original-Received: from localhost (localhost [127.0.0.1]) by smtp.gnu-rox.org (Postfix) with ESMTP id 8413B3E381; Tue, 21 Jan 2003 10:37:10 +0100 (CET) Original-Received: from fxgsproject.org.gnu-rox.org (unknown [10.0.0.10]) by smtp.gnu-rox.org (Postfix) with ESMTP id F1A063E37D; Tue, 21 Jan 2003 10:37:05 +0100 (CET) Original-To: Patrice Neff X-Face: 63TbQAY?C>dKDtNNr7 (Patrice Neff's message of "Tue, 21 Jan 2003 08:22:02 +0100") User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.3.50 (i686-pc-linux-gnu) X-Virus-Scanned: by AMaViS new-20020517 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:49420 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:49420 --=-=-= Content-Transfer-Encoding: quoted-printable On Tue, 21 Jan 2003, Patrice Neff told this: > Xavier MAILLARD writes: >=20=20 > > So I am :) Please gimme the tricks ;-) >=20=20 > Well, dunno about the code quality, but here is the modified Nevermind the quality code :) It's tricky code ;-) > function: =20=20 > (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=3D "encrypt" > pgp-p) (and (y-or-n-p "Encrypt message ? ") (call-interactively > 'mml-secure-encrypt-pgpmime))) ((string=3D "sign" pgp-p) (and > (y-or-n-p "Sign message ? ") (call-interactively > 'mml-secure-sign-pgpmime))) (t nil)))))))) Looks good to me. At least it does its job :) Thanx zeDek --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+LRSzw9rnDkzlHXERAjiZAKCLCJASJnG0hXLiflqDxdJdPrzH+ACeNp5X AQhhSbhyjqhph30+lbcDmwI= =gdib -----END PGP SIGNATURE----- --=-=-=--