<<< Date Index >>>     <<< Thread Index >>>

Re: mail directory structures in mutt



On Fri Jul 30, 2004 at 02:14:14PM +0200 Hendrik Mangels chose to say...
> Abhay Pradhan (2004-07-30, 17:15):
> > umm..has anybody ever felt the need for this? i mean, creating
> > directories on the fly? or is there another solution which i can adopt?
> 
> How often do you actually *need* such a feature? My mails are
> sorted and saved automatically. I am using Mutt for years now
> and never missed such a feature.

well, I think I do need that feature. Maybe i'm not as organized as you
are and maybe my mail directory structure is horrible, but there are a
lot of times when i read mail and i want to create and put it in a
folder "on the fly".

I use fetchmail+procmail+mutt and there are loads of times a few mails
cant be classfied into a recipe.

But then, maybe thats just me.

> 
> > what i could do is write a script which creates a directory which i pass
> > to it. would that work?
> 
> No. Thats far to complex for someone like you.

:)
I agree I'm not a great coder. Here is a small perl file. Lots of
warnings, horrible code, but it gets the job done for up to three levels
of nesting.

anybody good at perl here, do tell me how to get the number of arguments
passed directly? cuz the second foreach seems hopeless.

also, i'm sure i could write something more elegant than a boorish
system mkdir.. but i dont have the time right now.
i'm not happy with doing $details[0]/$details[1] etc.. maybe later?


<******************>
#!/usr/bin/perl

$numArgs = 0;

foreach (@ARGV) {
        @details = split /\//, $_;
}

foreach $token (@details) {
        $numArgs++;
}

if ($numArgs > 3){
        print "too many nested levels\n";
        exit;
}
else{
        system("mkdir /home/pradhan/mail/$details[0]");
        system("mkdir /home/pradhan/mail/$details[0]/$details[1]");
        system("mkdir /home/pradhan/mail/$details[0]/$details[1]/$details[2]");
}
<******************>

> 
> > as an aside.. does sven guckes hang around here? or has he taken a leave
> > of absence. if not this list, any idea which list he reads?
> 
> His occupation is "internet ghost".
> In some way he is always around.
> Be scared shitless!
> 

always am scared shitless. esp when he once asked me to tear my head
off.

> > I kind of
> > miss his acerbic comments (esp to the last idea i had about mutt)
> 
> You had an idea about mutt?
> Break a leg!

oh i just wanted to know if mutt had the concept of -attachlist and a
wildcard so that i could attach n number of files instead of doing

mutt -a file1 -a file2 etc

sven said thats not a mutt problem, write a bloody script.
ah well.. did that

cheers and thanks guys
if it wasnt for this mail, i wudnt have ever gotten around to writing
it.
somebody else asked me why i hadnt tried writing a script, well, i am
lazy and i didnt want to reinvent the wheel.

abhay