Anthony, et al --

...and then Anthony Towns said...
% 
% Hi,

Hello!


% 
% I've been getting gradually more annoyed with the way my mail archives are
% organised recently, and, after playing with Evolution a little bit, got to

*grin*


% thinking that vFolders might be the answer. So, I've been trying to figure
% out some way of doing the same sort of thing in mutt.

Interesting concept...  Since I have no interest in installing Evo, can
you point me somewhere to learn more about their concept and
implementation?


% 
% First, has anyone done this before? Is there a FAQ or HOWTO I could
% be reading?

Can't properly help you there until I really know what you mean :-)

I do know, though, that I've been itching for a real RDBMS back-end
for mailboxes so that I can simultaneously get around the "where do
I put this?" problem (eg, an offshoot mail to Bob really belongs in
Alice's thread and therefore her mailbox) and the "how do I avoid
duplication?" problem (sure, I could [somehow, as has been discussed
in fcc-save-hook threads before] save it in Bob's and Alice's folders,
but that's wasteful and it still doesn't point to Alice's from Bob's),
but that's a long way off.

I had been tinkering with an idea for approaching that by having one
single, potentially huge, canonical Maildir containing every message,
and then "virtual Maildirs" (which, BTW, need only the cur/ subdir)
with symlinks that point into the canonical dir.  The tricks are 1)
organizing the fake mailboxes and keeping them updated (procmail-ish)
and saving mail in them by actually writing symlinks and saving to the
big one (mutt-ish).  It's only a workaround anyway, so it probably
doesn't deserve much implementation effort, but it can stand some though
to look at ways to develop this.


% 
% What I'm thinking is basically having a huge morass of mail shoved in a
% directory somewhere, with a fancy index. Whenever I want to look at mail

Exactly.


% in there, I construct a query ("Show me all mail with [EMAIL PROTECTED]
% in the From/To/Cc headers" or "Show me all mail with message-id blah")
% and then have mutt show me all the mail that matches that query as a
% "virtual folder".

You can probably construct such a query with grepm (a mutt-driving
frontend for grepmail, as noted in another reply), but the trick is the
search time involved (and the fact that grepmail works on mbox files
specifically because they are trickier to parse at the shell level) and
typing out the command (probably easier with macros or a renamed script).


% 
% The easiest way to do this seems like it'd be to write a script which
% does the query and constructs a mailbox in Maildir format with all the
% appropriate messages in it, then have mutt look at that Maildir. That
% much I can do.

Again, see grepmail and grepm here.


% 
% What I can't figure out is how to run that script and make mutt look at
% the output in a reasonably effective way. What I'd _like_ is to be able
% to write a macro that asks me:
% 
%       "What email address:"
% 
% then runs  <change-folder>`/home/aj/mail/bin/query-by-addr "$result"`.

Why not just fire off a subprocess?


% 
% (I'd like to be able to have a few mutts doing queries at the same time,
% so the folder name needs to be determined somewhat dynamically to avoid
% clashes. I can't figure out how to do that with a macro either)
% 
% I could avoid the prompting by having my script do that, but I can't
% figure out any way to have a macro change to a dynamically-determined
% folder.

Looks OK if you change the implementation.


% 
% What would be ideal would be to have some sort of "user variable" that
% could be set, and some way of making a macro give a prompt then set one
% of those "user variables". Then I could say:
% 
%       macro index Q["What email address:",email] \
%               :set user_foldername=`query-by-addr "$email"`<enter> \
%               <change-folder><$foldername><enter>

You're asking for a scripting language; that's been requested before,
too :-)


% 
% or something similar. But I can't do that, and I'm stumped as to what else
% I can do.
% 
% Any ideas?

I'm quite interested in my two ideas above, but I'd also be interested in
a quick indexing system for Maildir and a way for mutt, this indexing
system, and a "search and assembly" tool to work together on compressed
mailboxes.


% 
% Cheers,
% aj
% 
% -- 
% Anthony Towns <[EMAIL PROTECTED]> <http://azure.humbug.org.au/~aj/>
% I don't speak for anyone save myself. GPG signed mail preferred.
% 
%      ``BAM! Science triumphs again!'' 
%                     -- http://www.angryflower.com/vegeta.gif


TIA & HAND & Good luck!

:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg28221/pgp00000.pgp
Description: PGP signature

Reply via email to