From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/42150 Path: main.gmane.org!not-for-mail From: Karra Newsgroups: gmane.emacs.gnus.general Subject: pgp/mime encryption with specified public-key Date: Fri, 18 Jan 2002 11:59:14 +0530 Sender: owner-ding@hpc.uh.edu Message-ID: <87d708dvet.fsf@cs.utah.edu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035177431 9844 80.91.224.250 (21 Oct 2002 05:17:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:17:11 +0000 (UTC) Return-Path: Original-Received: (qmail 21860 invoked from network); 18 Jan 2002 11:17:01 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 18 Jan 2002 11:17:01 -0000 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 16RX0c-0004SG-00; Fri, 18 Jan 2002 05:16:34 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 18 Jan 2002 05:16:24 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id FAA11185 for ; Fri, 18 Jan 2002 05:16:08 -0600 (CST) Original-Received: (qmail 21851 invoked by alias); 18 Jan 2002 11:16:10 -0000 Original-Received: (qmail 21846 invoked from network); 18 Jan 2002 11:16:04 -0000 Original-Received: from unknown (HELO Gowron) (mail@210.214.1.32) by gnus.org with SMTP; 18 Jan 2002 11:16:04 -0000 Original-Received: from karra by Gowron with local (Exim 3.12 #1 (Debian)) id 16RSav-0000ei-00 for ; Fri, 18 Jan 2002 12:03:45 +0530 Original-To: ding@gnus.org User-Agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.1 (i686-pc-linux-gnu) Original-Lines: 96 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:42150 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:42150 --=-=-= [ using mailcrypt 3.5.5 ] By default, the public keys that are looked up are the based on the recipient email ids in the message. I want to specify another key instead (say because I am sending a message to a friend who uses the same gpg key pair on different acounts). If there is a legit way of doing this, pray explain it and ignore the rest of this mail. As I could not get to do the above, I executed the following patch: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=message.diff --- message.el.old Fri Jan 18 11:27:41 2002 +++ message.el Fri Jan 18 11:27:45 2002 @@ -2573,7 +2573,7 @@ (success t) elem sent dont-barf-on-no-method (message-options message-options)) - (message-options-set-recipient) +; (message-options-set-recipient) (while (and success (setq elem (pop alist))) (when (funcall (cadr elem)) --=-=-= Now, when I C-c C-c a message, I was queried for a list of recipients. I entered one word : "rajiv" and I was greeted by the following backtrace: --=-=-= Content-Disposition: attachment signal(error ("mc-encrypt-generic: recipients not string or nil")) error("mc-encrypt-generic: recipients not string or nil") mc-encrypt-generic(("rajiv") nil nil nil nil) (let (default-enable-multibyte-characters) (mc-encrypt-generic (or ... ...) nil nil nil (message-options-get ...))) (if mm-mule4-p (let (... ...) (unwind-protect ... ... ...)) (let (default-enable-multibyte-characters) (mc-encrypt-generic ... nil nil nil ...))) (mm-with-unibyte-current-buffer-mule4 (mc-encrypt-generic (or ... ...) nil nil nil (message-options-get ...))) (let ((mc-pgp-always-sign ...)) (mm-with-unibyte-current-buffer-mule4 (mc-encrypt-generic ... nil nil nil ...))) mml2015-mailcrypt-encrypt((part (encrypt . "pgpmime") (tag-location . 358) (contents . "\n;alskdf;lsakf\n\n-- \n\"Have you ever fought an IDEA, Picard?\"\n -- Gowron, Star Trek TNG.\n"))) mml2015-encrypt((part (encrypt . "pgpmime") (tag-location . 358) (contents . "\n;alskdf;lsakf\n\n-- \n\"Have you ever fought an IDEA, Picard?\"\n -- Gowron, Star Trek TNG.\n"))) mml-pgpmime-encrypt-buffer((part (encrypt . "pgpmime") (tag-location . 358) (contents . "\n;alskdf;lsakf\n\n-- \n\"Have you ever fought an IDEA, Picard?\"\n -- Gowron, Star Trek TNG.\n"))) mml-generate-mime-1((part (encrypt . "pgpmime") (tag-location . 358) (contents . "\n;alskdf;lsakf\n\n-- \n\"Have you ever fought an IDEA, Picard?\"\n -- Gowron, Star Trek TNG.\n"))) mml-generate-mime() (let ((new ...)) (when new (delete-region ... ...) (insert new) (goto-char ...) (if ... ... ... ... ...))) (save-restriction (narrow-to-region (point) (point-max)) (let (...) (when new ... ... ... ...))) (let ((mail-parse-charset ...) (case-fold-search t) lines content-type-p) (message-goto-body) (save-restriction (narrow-to-region ... ...) (let ... ...)) (save-restriction (message-narrow-to-headers-or-head) (message-remove-header "Mime-Version") (goto-char ...) (insert "MIME-Version: 1.0\n") (when lines ...) (setq content-type-p ...)) (save-restriction (message-narrow-to-headers-or-head) (message-remove-first-header "Content-Type") (message-remove-first-header "Content-Transfer-Encoding")) (unless content-type-p (goto-char ...) (when ... ... ...))) (if message-inhibit-body-encoding nil (let (... ... lines content-type-p) (message-goto-body) (save-restriction ... ...) (save-restriction ... ... ... ... ... ...) (save-restriction ... ... ...) (unless content-type-p ... ...))) (unless message-inhibit-body-encoding (let (... ... lines content-type-p) (message-goto-body) (save-restriction ... ...) (save-restriction ... ... ... ... ... ...) (save-restriction ... ... ...) (unless content-type-p ... ...))) message-encode-message-body() (save-excursion (set-buffer tembuf) (erase-buffer) (insert (with-current-buffer mailbuf ...)) (message-encode-message-body) (save-restriction (message-narrow-to-headers) (when ... ...) (message-remove-header message-ignored-mail-headers t) (let ... ...)) (goto-char (point-max)) (or (= ... 10) (insert 10)) (when (save-restriction ... ...) (message-insert-courtesy-copy)) (if (or ... ... ...) (mm-with-unibyte-current-buffer ... ...) (message-send-mail-partially))) (unwind-protect (save-excursion (set-buffer tembuf) (erase-buffer) (insert ...) (message-encode-message-body) (save-restriction ... ... ... ...) (goto-char ...) (or ... ...) (when ... ...) (if ... ... ...)) (kill-buffer tembuf)) (let* ((tembuf ...) (case-fold-search nil) (news ...) (mailbuf ...) (message-this-is-mail t) (message-posting-charset ...) (headers message-required-mail-headers)) (save-restriction (message-narrow-to-headers) (if ... ... ...) (let ... ...) (run-hooks ...)) (unwind-protect (save-excursion ... ... ... ... ... ... ... ... ...) (kill-buffer tembuf)) (set-buffer mailbuf) (push (quote mail) message-sent-message-via)) message-send-mail(nil) message-send-via-mail(nil) funcall(message-send-via-mail nil) (setq success (funcall (caddr elem) arg)) (and (or (not ...) (if ... ... ...)) (setq success (funcall ... arg))) (if (and (or ... ...) (setq success ...)) (progn (setq sent t))) (when (and (or ... ...) (setq success ...)) (setq sent t)) (progn (when (and ... ...) (setq sent t))) (if (funcall (cadr elem)) (progn (when ... ...))) (when (funcall (cadr elem)) (when (and ... ...) (setq sent t))) (while (and success (setq elem ...)) (when (funcall ...) (when ... ...))) (let ((alist message-send-method-alist) (success t) elem sent dont-barf-on-no-method (message-options message-options)) (while (and success ...) (when ... ...)) (unless (or sent ... ...) (error "No methods specified to send by")) (when (or dont-barf-on-no-method ...) (message-do-fcc) (save-excursion ...) (message "Sending...done") (set-buffer-modified-p nil) (delete-auto-save-file-if-necessary t) (message-disassociate-draft) (message-do-send-housekeeping) (message-do-actions message-send-actions) t)) message-send(nil) message-send-and-exit(nil) call-interactively(message-send-and-exit) --=-=-= It appears the problem is because mailcrypt expects a single string of comma separated id, but it was given a list -- because message-recipients is a list. It is interesting to note that using the above patch, vanilla pgp encryption works, as in I get queried for a list of recipients and the corresponding public keys are fetched etc. Perhaps, this is because mml2015-mailcrypt-encrypt is invoked more than once on a message, but mml1991-mailcrypt-encrypt is invoked only once. -- "Have you ever fought an IDEA, Picard?" -- Gowron, Star Trek TNG. --=-=-=--