Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

mail paths and IMAP



Hi,

I'm having trouble twisting the new completion system to another of my
whims.  I'd like to be able to tab-complete IMAP mail-folders.  I have
GSSAPI authentication, so no password prompt is needed, and I have a
tool which will list all subscribed folders, one per line.  I can make
this work interactively, but want to automate it.  Could someone please
point me to which bit of the completion system I need to be using to do
this (preferably a snippet, if it's "just" configuration):

If I type:

% mutt -f +<TAB><Ctrl-C>
% klist -t && set -A _mbox_cache ${(@f):-"$(mailcheck -B -l 2>/dev/null)"}

(and have mutt "set folder=imap://$IMAP_SERVER/") then I can
tab-complete as desired.

The problem is setting this up to work without first kicking _mailboxes
into life, to create the cache.  I know that the above is bad and wrong
because it's messing with internals.

I can set explicit IMAP URLs into $mailpath, but that doesn't help since
zsh isn't too happy with the URLs:

% set -A mailboxes imap://$IMAP_SERVER/${^${(@f):-"$(mailcheck -B -l 2>/dev/null)"}// /%20}

Is there a way to do this "properly" without changing the completion
widgets?  Failing that, is there a way to initialise the stuff without
typing in the "mutt -f +<TAB>" part, so that I can use the _mbox_cache
hack above?

Thank you,
-- 
VISTA: Viruses, Infections, Spyware, Trojans & Adware



Messages sorted by: Reverse Date, Date, Thread, Author