From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68489 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general,gmane.emacs.tramp Subject: Re: file storage in IMAP (eventually for Tramp) working and needs testing Date: Fri, 24 Apr 2009 09:37:47 +0900 Message-ID: References: <86k5n1443g.fsf@lifelogs.com> <86k55otuwi.fsf@lifelogs.com> <86vdp7qk67.fsf@lifelogs.com> <87bpqx1vfv.fsf@gmx.de> <86k55cb4ye.fsf@jumptrading.com> <87ocuoozpr.fsf@broken.deisui.org> <86fxfzbkic.fsf@lifelogs.com> <86zle7a3in.fsf@lifelogs.com> <7d371a60-fbac-4b0e-a6b3-2001292f0205@broken.deisui.org> <46c9c7d6-ae70-41f0-a8dd-b2eea679588b@broken.deisui.org> <86r5zj9z96.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1240533577 516 80.91.229.12 (24 Apr 2009 00:39:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Apr 2009 00:39:37 +0000 (UTC) Cc: ding@gnus.org, tramp-devel@mail.freesoftware.fsf.org To: Ted Zlatanov Original-X-From: ding-owner+M16924@lists.math.uh.edu Fri Apr 24 02:40:56 2009 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lx9TH-0002zf-2J for ding-account@gmane.org; Fri, 24 Apr 2009 02:40:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Lx9Qk-0003vZ-QD; Thu, 23 Apr 2009 19:38:14 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Lx9Qi-0003vA-Ii for ding@lists.math.uh.edu; Thu, 23 Apr 2009 19:38:12 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1Lx9Qc-0008Bt-8r for ding@lists.math.uh.edu; Thu, 23 Apr 2009 19:38:12 -0500 Original-Received: from wf-out-1314.google.com ([209.85.200.175]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1Lx9R2-0003ct-00 for ; Fri, 24 Apr 2009 02:38:32 +0200 Original-Received: by wf-out-1314.google.com with SMTP id 28so659855wfc.26 for ; Thu, 23 Apr 2009 17:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :references:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=1If3nPEEzIgo+6Eg1qAE1rgi/SkVixZh0ON1bhGkQ9o=; b=kKW18MXi2clEH6iR5Uz6Wh+BMKFUc0PPjTx+33Hj/TXWivinN3+XVUej3RRqzZHyGN /1OOC34cP/Jprc49Rshb56mvmTQSgVQUtDc7+3DhqpoAS9ICdaN7JBTlTXXvZRSBpZdn P46aAKHacmbcvp4RhVZIXynyMrLT+dx3fxhp0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=XsoopenJAsUCAjaQ2qdQI3gta3fNKVjD44WBDbMUt615SIZTagRtpjFfLxYerST8hX ihiJS9fgvsDPJJYLSWhD7+9xTUiCdQNuAjNPzYQbG0wHgcCWSPPzBh8vkE1dM7HHXWxK H8tuthWuzckRl6+jpPAYQUBdfRX+odid/P7dI= Original-Received: by 10.142.82.13 with SMTP id f13mr525583wfb.290.1240533483312; Thu, 23 Apr 2009 17:38:03 -0700 (PDT) Original-Received: from chilled (221x255x76x222.ap221.ftth.ucom.ne.jp [221.255.76.222]) by mx.google.com with ESMTPS id 28sm1517136wfg.28.2009.04.23.17.38.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Apr 2009 17:38:02 -0700 (PDT) In-Reply-To: <86r5zj9z96.fsf@lifelogs.com> (Ted Zlatanov's message of "Thu, 23 Apr 2009 10:16:21 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68489 gmane.emacs.tramp:6826 Archived-At: --=-=-= >>>>> In <86r5zj9z96.fsf@lifelogs.com> >>>>> Ted Zlatanov wrote: > - EPG asks for the passphrase. It should try tramp-imap-passphrase as a > string first (I'll add the alist and function call support later). As > an extra courtesy to the user, if the passphrase is nil, we should ask > interactively if encryption is wanted, and if yes, read the > passphrase. Would you be willing to make that addition? Yes, here is a patch to do that. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=tramp-imap.el.diff --- tramp-imap.el~ 2009-04-24 08:59:11.000000000 +0900 +++ tramp-imap.el 2009-04-24 09:01:16.000000000 +0900 @@ -738,12 +738,17 @@ (error "Could not find the body separator in the encoded message!"))) (current-buffer))) +(defun tramp-imap-passphrase-callback-function (context key-id handback) + (or tramp-imap-passphrase + (epa-passphrase-callback-function context key-id handback))) + (defun tramp-imap-encode-buffer () (let ((context (epg-make-context 'OpenPGP)) cipher) (epg-context-set-armor context t) - (epg-context-set-passphrase-callback context - #'epa-passphrase-callback-function) + (epg-context-set-passphrase-callback + context + #'tramp-imap-passphrase-callback-function) (epg-context-set-progress-callback context (cons #'epa-progress-callback-function "Encrypting...")) @@ -758,8 +763,9 @@ (defun tramp-imap-decode-buffer () (let ((context (epg-make-context 'OpenPGP)) plain) - (epg-context-set-passphrase-callback context - #'epa-passphrase-callback-function) + (epg-context-set-passphrase-callback + context + #'tramp-imap-passphrase-callback-function) (epg-context-set-progress-callback context (cons #'epa-progress-callback-function "Decrypting...")) --=-=-= > - I had to clean ^M characters from the buffer before; EPG seems to > handle them automatically so I removed this code > ;; TODO: do this better, removes all ^M in the buffer > (goto-char (point-min)) > (while (re-search-forward "^M" nil t) ;; this was the literal ^M > (replace-match "" nil nil)) > from tramp-imap-get-file. Is that OK? I think so - if data do not roundtrip before/after encryption, it seems a bug... Regards, -- Daiki Ueno --=-=-=--