[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp-IMAP works and needs testing

From: Ted Zlatanov
Subject: Re: Tramp-IMAP works and needs testing
Date: Sun, 06 Sep 2009 23:13:07 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux)

On Sat, 18 Jul 2009 13:11:51 +0200 Michael Albinus <address@hidden> wrote: 

MA> - Several functions in `tramp-imap-file-name-handler-alist' are not
MA>   implemented yet.

I'm trying to get basic file read/write working before those other
functions.  Should I just set them to nil for now?

Sorry for the delay, also.  I've been busy and the weekends are too short...

MA> - I doubt there will be implementation for `shell-command',
MA> `executable-find', and `process-file'. I've disabled them in
MA> `tramp-imap-file-name-handler-alist'.


MA> - You have used `tramp-debug-message'. I recommend to use
MA>   `tramp-message' instead, the verbose levels allow a better analysis of
MA>   the debug buffer.


MA> - `tramp-imap-handle-file-directory-p' must not return nil in all
MA>   cases. When I apply (save-buffer), the imap folder is checked for
MA>   being a directory. As workaround, I've changed
MA>   `tramp-imap-handle-file-directory-p' to return `t', but it must be
MA>   more precise.

This is actually tough, because an entry could be both.  We could have
the files INBOX.test/b and INBOX.test/b/c at the same time.  I will have
to make the directory name the mailbox name and everything above that
the filename.  Thus no subdirectories are allowed, which simplifies the
logic.  Otherwise I don't think Tramp can handle it.  So:

/imap:address@hidden:/INBOX.test = directory
/imap:address@hidden:/INBOX.test/ = directory
/imap:address@hidden:/INBOX.test/1 = file "1"
/imap:address@hidden:/INBOX.test/1/2 = illegal file name

I think that's sufficient for most users.  I hate to kill functionality
this way, but otherwise things will get too confusing.  Does that sound
OK to you?

MA> - When I have opened "/imap:address@hidden:/INBOX.test/1", and try to
MA>   save it under the name "/imap:address@hidden:/INBOX.test/2", I get

MA>   Debugger entered--Lisp error: (none "bad name 1 or mailbox INBOX.test/2")
MA>   signal(none ("bad name 1 or mailbox INBOX.test/2"))
MA>   tramp-error(["imap" "albinus" "localhost" "/INBOX.test/2/1"] none "bad 
name %s or mailbox %s" "1" "INBOX.test/2")
MA>   (if (and name (imap-mailbox-select mbox)) (let (sname) 
(tramp-debug-message vec "looking for '%s'" search-name) (dolist ... ... ...)) 
(tramp-error vec (quote none) "bad name %s or mailbox %s" name mbox))
MA>   (let* ((mbox ...) (name ...) (truename ...) (search-name ...) res) 
(tramp-debug-message vec "selecting mbox %s" mbox) (if (and name ...) (let ... 
... ...) (tramp-error vec ... "bad name %s or mailbox %s" name mbox)) res)
MA>   (save-current-buffer (set-buffer (tramp-imap-buffer vec)) (let* (... ... 
... ... res) (tramp-debug-message vec "selecting mbox %s" mbox) (if ... ... 
...) res))
MA>   (with-current-buffer (tramp-imap-buffer vec) (let* (... ... ... ... res) 
(tramp-debug-message vec "selecting mbox %s" mbox) (if ... ... ...) res))
MA>   tramp-imap-get-file-entries(["imap" "albinus" "localhost" 
"/INBOX.test/2/1"] "/INBOX.test/2/1")

MA>   [...]

OK.  I think the code is a mess, I'll improve it as stated above and below.

MA> - I've fixed a small error in `tramp-imap-handle-delete-file' and
MA>   `tramp-imap-delete-files'.

MA> - `tramp-retrieve-data', used in `tramp-imap-handle-file-local-copy',
MA>   does not exist.

MA> - In `tramp-imap-passphrase-callback-function', you use the non-existing
MA>   variable `v'.

Thanks for these.  For tramp-imap-retrieve-data I was looking at the
tramp-fish.el code, which has that function.  I think in general my code
needs to be redone, it's too messy.  I was just playing around when I
put it together; the core functionality is OK but it's a mess of
spaghetti code that I would hate to support.  I'll try to rewrite it
before the next Tramp release.  I'm attaching the last spaghetti
version, I hope.

In the passphrase callback, I don't have access to the Tramp context.  I
only have the EPG context.  

Daiki Ueno: is it OK if I insert the Tramp context (basically a cons) at
the end of the EPG context?  It will make the EPG context longer by 1
element so I worry it may break things in EPG.  If not, how can I pass
the Tramp context to the passphrase callback?

MA> - The email address of stored messages looks like "a real one", one
MA>   could try to send messages there. Better might be to use an invalid
MA>   address as defined in RFC 2606, like "Tramp-IMAP
MA>   <address@hidden>".



Attachment: tramp-imap.el
Description: application/emacs-lisp

reply via email to

[Prev in Thread] Current Thread [Next in Thread]