From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/53482 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?q?Jochen_K=FCpper?= Newsgroups: gmane.emacs.gnus.general,gmane.emacs.bbdb.user Subject: Re: PGG and BBDB ? Date: Sun, 20 Jul 2003 20:34:00 +0200 Organization: Fritz-Haber-Institut der MPG Sender: ding-owner=qhrM8SXbD5ICJmmTlSVZx4dd74u8MsAO@public.gmane.org Message-ID: <861xwljbdz.fsf@doze.rijnh.nl> References: Reply-To: bbdb-info=5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org 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 1058726078 10979 80.91.224.249 (20 Jul 2003 18:34:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Jul 2003 18:34:38 +0000 (UTC) Cc: BBDB-Info Original-X-From: ding-owner+M2027@lists.math.uh.edu Sun Jul 20 20:34:36 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 19eJ12-0002qt-00 for ; Sun, 20 Jul 2003 20:34:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19eJ1j-0000lS-00; Sun, 20 Jul 2003 13:35:19 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19eJ1Z-0000lK-00 for ding@lists.math.uh.edu; Sun, 20 Jul 2003 13:35:09 -0500 Original-Received: (qmail 31854 invoked by alias); 20 Jul 2003 18:35:08 -0000 Original-Received: (qmail 31849 invoked from network); 20 Jul 2003 18:35:08 -0000 Original-Received: from huygens.rijnh.nl (192.42.124.30) by sclp3.sclp.com with SMTP; 20 Jul 2003 18:35:08 -0000 Original-Received: from doze.rijnh.nl.fhi-berlin.mpg.de (dhcp124-216.rijnh.nl [192.42.124.216]) by huygens.rijnh.nl (SGI-8.12.5/8.12.5) with ESMTP id h6KIYqPm153157; Sun, 20 Jul 2003 20:34:52 +0200 (MET_DST) Original-To: ding=smP1P7uqpqc@public.gmane.org X-Archive: encrypt X-Attribution: Jochen Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUcGRSqioSCPi7Cwbxu Vk5MQjycXkxMKiQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFG2qEAAAB5klEQVR42nXUwY7aMBAA UK8E4tqpI/fMKIWzFdBewcwm10WA9tpksz6zFci/37GdxF7a+mLwi2fGQ4yo/jPE9AkaIcRM/gU7 EcfTA/zgtWsuEfRmWPVjlsOryMYpAYgvYz9B8RXmhxHEw/gcQD+sz/cDbMLXhbu7a6j6Nob6FuDW U21+uje8nuUA/rnXxR4ArCWi5jhWJSJUmoWop7HckPt+Bz6PsrYmexgg5HY3CDvKuq/lAM9hB4VQ HfZEMt8xj2BLSrD1cDlThNJMoXSEWnroDJr3HM5nDtUbRIPuluDqLlx8YdYuh0o87S6+DWANUrn+ Pf0eO7vh1Awf98XKXi/jAatnCwU/Bebl5pZqjRNs2xa4IcoqdEuN5QSbFn3pYLkqqbtyLLfSEbQi XEn4jsvpZRiAO7UCUCYBhE7zhAgSclAyToiSO5xgA+8RONYqD6X3YYdWnakJU1WVPsaI0LXU5VBF kMr6aJTBPk4KfP5SJoAYEXpE5/4FVnVrpHQ/tny/pAduZl/bBDsGLbkqD7ZN0PgbCfwucPL49gzd pZmPw22SoPoc+iZkAL+J6nRrdQEHf+4Qqm4TFJJ8idxYrumY/QEAFHQI65xhcZqgOEHhTAhk6WUu jgPohnc4wgD21+zN+c79AZmNym6Cgz4IAAAAAElFTkSuQmCC X-URL: http://jochen-kuepper.de In-Reply-To: (Xavier Maillard's message of "Sun, 20 Jul 2003 19:40:14 +0200") Mail-Followup-To: bbdb-info@lists.sourceforge.net Original-Lines: 27 Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:53482 gmane.emacs.bbdb.user:1190 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:53482 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Transfer-Encoding: quoted-printable On Sun, 20 Jul 2003 19:40:14 +0200 Xavier Maillard wrote: Xavier> Is anybody aware of some functions/modules being able to make BBDB = and Xavier> PGG paly nicely together ? Xavier> I mean : does PGG would know when it can automatically encrypt/sign= a Xavier> message according to a BBDB field ? There is bbdb-pgp.el in bbdb/bits. I use a slightly modified version (i.e. no mailcrypt required, configurable to ask less questions...). I am not sure how the "no-mailcrypt" issue should be handled correctly. Once it is, I would like to see it updated in bbdb cvs. Greetings, Jochen --=20 FOM-Institute for Plasma Physics "Rijnhuizen" + Fritz-Haber-Institut der MPG Postbus 1207 Faradayweg 4-6 NL-3430 BE Nieuwegein D-14195 Berlin The Netherlands Germany phone: +31-30-6096756 +49-30-84135686 fax: +31-30-6031204 GnuPG key: CC1B0B4D --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=bbdb-pgp.el Content-Transfer-Encoding: quoted-printable ;;; bbdb-pgp.el --- use BBDB to store PGP preferences ;; Copyright (C) 1997,1999 Kevin Davidson ;; Author: Kevin Davidson tkld=MicbuCNEgiFl57MIdRCFDg@public.gmane.org ;; Maintainer: Kevin Davidson tkld=MicbuCNEgiFl57MIdRCFDg@public.gmane.org ;; Created: 10 Nov 1997 ;; Version: $Revision: 1.5 $ ;; Keywords: PGP BBDB message mailcrypt =20 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; A copy of the GNU General Public License can be obtained from this ;; program's author (send electronic mail to tkld=MicbuCNEgiFl57MIdRCFDg@public.gmane.org) or ;; from the Free Software Foundation, Inc.,59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;; LCD Archive Entry: ;; bbdb-pgp|Kevin Davidson|tkld=MicbuCNEgiFl57MIdRCFDg@public.gmane.org ;; |Use BBDB to store PGP preferences ;; |$Date: 2003/07/14 18:46:14 $|$Revision: 1.5 $|~/packages/bbdb-pgp.el ;;; Commentary: ;; ;; It is believed that encrypted mail works best if all mail between ;; individuals is encrypted - even concerning matters that are not ;; confidential. The reasoning is that confidential messages cannot ;; then be easily spotted and decryption efforts concentrated on them. ;; Some people therefore prefer to have all their email encrypted. ;; This package allows you to mark the BBDB entries for those ;; individuals so that messages will be encrypted when they are sent. ;; ;; These packages are required: BBDB, mailcrypt, message ;; ;; message.el is included with recent versions of Emacs. ;; You can use mail-mode as well as message-mode to send mail. ;;; Usage: ;; (require 'bbdb-pgp) ;; ;; Then for all users who you want to send encrypted mail to, add the field ;; pgp-mail with the value `encrypt'. Alternatively you can add the value ;; `sign' if you just want to send signed messages. ;; ;; and possibly (if you do not want the PGP field printed out) ;; (add-hook 'bbdb-print-elide bbdb-pgp-field) ;;=20 ;; The variable bbdb/pgp-default-action defines what to do if the recipient ;; is not in the BBDB. ;;; TODO ;; Spot incoming PGP mail by hooking into mc-verify/decrypt and adding pgp-= mail ;; field to BBDB entry (creating one if necessary); like bbdb-sc.el maintai= ns ;; attribution prefs. ;;; PGP Public Key ;; The author's public key is available from any public PGP keyserver ;; eg http://www.pgp.net/pgpnet/ ;; Fingerprint: 1F A9 3F 3E 90 F7 85 64 55 35 32 C8 75 91 3A E3 ;;; Change log: ;; $Log: bbdb-pgp.el,v $ ;; Revision 1.5 2003/07/14 18:46:14 jochen ;; *** empty log message *** ;; ;; Revision 1.4 2003/07/14 18:21:01 jochen ;; Synchronize ;; ;; Revision 1.3 2002/10/20 18:03:42 waider ;; *** empty log message *** ;; ;; Revision 1.2 2002/10/18 10:54:34 waider ;; allows bbdb-pgp.el to be configured to use message.el MML tags to perform ;; the signing and encryption, instead of only plain Mailcrypt which is not ;; MIME-aware. (Michael Shields) ;; ;; Revision 1.1 2001/01/24 21:19:08 waider ;; Add-ons that didn't make it to the current release. ;; ;; Revision 1.4 1999/01/05 13:17:00 tkld ;; Update GPL version number and FSF snail mail address. ;; ;; Revision 1.3 1997/11/10 15:20:29 tkld ;; Expand commentary. Support encrypt/sign. Support mail-mode ;; (sendmail.el). ;; ;; Revision 1.3 1997/11/10 15:10:19 tkld ;; Update commentary. Support sendmail.el. Support signing or encrypting. ;; ;; Revision 1.2 1997/11/10 14:27:07 tkld ;; Remembered to widen buffer before encrypting. ;; ;; Revision 1.1 1997/11/10 14:22:06 tkld ;; Initial revision ;; ;;; Code: (require 'message) (require 'bbdb) (condition-case nil (require 'mailcrypt) (error nil)) (defconst bbdb/pgp-version (substring "$Revision: 1.5 $" 11 -2) "$Id: bbdb-pgp.el,v 1.5 2003/07/14 18:46:14 jochen Exp $ Report bugs to: Kevin Davidson tkld=MicbuCNEgiFl57MIdRCFDg@public.gmane.org") ;;;###autoload (defgroup bbdb-utilities-pgp nil "Automatically sign and/or encrypt outgoing messages." :link '(emacs-library-link :tag "Lisp Source File" "bbdb-pgp.el") :group 'bbdb-utilities) (defcustom bbdb/pgp-field 'pgp-mail "*Field to use in BBDB to store PGP preferences. If this field's value in a record is \"encrypt\" then messages are encrypted. If it is \"sign\" then messages are signed." :type 'symbol :tag "BBDB Field" :require 'bbdb :group 'bbdb-utilities-pgp) (defcustom bbdb/pgp-method 'mailcrypt "*How to sign or encrypt messages. 'mailcrypt means use Mailcrypt. 'mml-pgp means add MML tags for Message to use old PGP format 'mml-pgpmime means add MML tags for Message to use PGP/MIME 'mml-smime means add MML tags for Message to use S/MIME" :type '(choice (const :tag "Mailcrypt" mailcrypt :require 'mailcrypt) (const :tag "MML PGP" mml-pgp :require 'mml) (const :tag "MML PGP/MIME" mml-pgpmime :require 'mml) (const :tag "MML S/MIME" mml-smime :require 'mml)) :tag "Signing/Encryption Method" :group 'bbdb-utilities-pgp) (defcustom bbdb/pgp-default-action nil "*Default action when sending a message and the recipient is not in BBDB. nil means do nothing. 'encrypt means encrypt message. 'sign means sign message." :type '(choice (const :tag "Do Nothing") (const :tag "Encrypt" encrypt) (const :tag "Sign" sign)) :tag "Default Action" :group 'bbdb-utilities-pgp) (defcustom bbdb/pgp-quite nil "*Do not ask for confirmation on pgp-action. nil means normal messages/questions. 't means to be quite." :type '(choice (const :tag "normal") (const :tag "quite" t)) :tag "Quiteness" :group 'bbdb-utilities-pgp) (defun bbdb/pgp-get-pgp (name address) "Look up user NAME and ADDRESS in BBDB and return the PGP preference." (let* ((record (bbdb-search-simple name address)) (pgp (and record (bbdb-record-getprop record bbdb/pgp-field)))) pgp)) (defun bbdb/pgp-sign () "Sign a message. bbdb/pgp-method controls the method used." (cond ((eq bbdb/pgp-method 'mailcrypt) (mc-sign 0)) ((eq bbdb/pgp-method 'mml-pgp) (mml-secure-message-sign-pgp)) ((eq bbdb/pgp-method 'mml-pgpmime) (mml-secure-message-sign-pgpmime)) ((eq bbdb/pgp-method 'mml-smime) (mml-secure-message-sign-smime)) (t (error 'invalid-state "bbdb/pgp-method")))) (defun bbdb/pgp-encrypt () "Encrypt and sign a message. bbdb/pgp-method controls the method used." (cond ((eq bbdb/pgp-method 'mailcrypt) (mc-encrypt 0)) ((eq bbdb/pgp-method 'mml-pgp) (mml-secure-message-encrypt-pgp)) ((eq bbdb/pgp-method 'mml-pgpmime) (mml-secure-message-encrypt-pgpmime)) ((eq bbdb/pgp-method 'mml-smime) (mml-secure-message-encrypt-smime)) (t (error 'invalid-state "bbdb/pgp-method")))) (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'. The user is prompted before encryption or signing." (save-restriction (save-excursion (message-narrow-to-headers) (and (featurep 'mailalias) (not (featurep 'mailabbrev)) mail-aliases (expand-mail-aliases (point-min) (point-max))) (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)=20 (and (or bbdb/pgp-quite (y-or-n-p "Encrypt message? ")) (bbdb/pgp-encrypt))) ((string=3D "sign" pgp-p) (and (or bbdb/pgp-quite (y-or-n-p "Encrypt message? ")) (bbdb/pgp-sign))) (t (cond ((eq bbdb/pgp-default-action 'encrypt) (and (y-or-n-p "Encrypt message? ") (bbdb/pgp-encrypt))) ((eq bbdb/pgp-default-action 'sign) (and (y-or-n-p "Sign message? ") (bbdb/pgp-sign))) (t nil)))))))))) (add-hook 'message-send-hook 'bbdb/pgp-hook-fun) (add-hook 'mail-send-hook 'bbdb/pgp-hook-fun) (provide 'bbdb-pgp) ;;; bbdb-pgp.el ends here --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (Cygwin) iD8DBQA/GuCZ7eYXdswbC00RAmiFAKCGTmVpkBCzKDVFiRfna/V60YDyZgCeJFOy VdMHzIAi0SUcxPYH4K8GJ1s= =7Xio -----END PGP SIGNATURE----- --==-=-=--