[ Gerard ROBIN wrote on Sun 23.Sep'12 at  0:59:17 +0200 ]

 
> PATH=$HOME/bin:/usr/bin:/bin:.
> 
> # For system mbox
> # MAILDIR=$HOME/Mail
> # DEFAULT=$MAILDIR/mbox
> 
> # For system maildir
> MAILDIR=$HOME/Maildir # You would better make sure it exists
> DEFAULT=$MAILDIR/.mbox
> LOGFILE=$MAILDIR/.procmail.log
> LOCKFILE=$HOME/.lockmail
> ORGMAIL=$MAILDIR/.emergency-inbox
> ..................................

 
> Yes and now with : set spoolfile="~/Maildir/" when I run mutt, I see my
> last messages non sorted by procmail and if I press the keys c and ? I see 
> the contents of ~/Maildir. But there is yet a problem : if I come back to 
> the parent directory .. and put the cursor on Maildir and I press Enter 
> I see my last mails (which are in ~/Maildir/.mbox/cur) ok, but now c and ? 
> gives
> me the content of /home/$user ! I can't access the contents of ~/Maildir    
> except by giving the path /home/$user/Maildir :(
> I don't understand the origin of the problem ?
 
 
> Yes I will do that to create the tree structure of ~/Maildir which suits me.
> But should I put a dot before the directories's name as does mb2md ?
> (sorry in my previous post I wrote "point" instead of dot) 
 
> Thank you very much for the time you spent to understand my problem.

Ok, I see you have a non-standard mbox set up, in that you were not using 
/var/[spool]/mail/$user as the system mbox. 

How do you wish to proceed? What I mean is, do you want to have mailboxes set 
up in exactly the same way as before or, do you want to start over and have 
your system spoolfile to something other than ~/Maildir/mbox?

What I would do now is firstly:

1 -     forget mb2md. You don't need it, you can set up Maildirs quite easily. 
Also, the Maildir++ format is probably not want you want.

2 -     move (mv(1)) your current ~/Maildir to another name. You won't lose 
your mail, it'll just be in another directory.

3 -     If you just want ~/Maildir as the top-level directory AND for it to be 
your main spoolfile which is common, then run the following command: mkdir -p 
Maildir/{cur,new,tmp} and set $folder and $spoolfile in muttrc to this 
directory (or $MAIL environment variable but we won't go there yet, just to 
avoid confusion. Note: $folder must be set to ~/Maildir whatever options you 
choose. 

4 -     If However, you want to have a sub-directory as your spoolfile as you 
did in your original set up, run this command: 

                mkdir -p ~/Maildir/spoolefilename/{cur,new,tmp}

        So to clarify, if say you want keep ~/Maildir/mbox as you system 
spoolfile your command would be: 

                mkdir -p ~/Maildir/mbox/{cur,new,tmp} which would match what 
you have in your procmailrc file. 

So, to make mutt work with these directories, your muttrc would look something 
like this:

        set folder=~/Maildir
        set spoolfile=+mbox

You would have to set the $folder variable because ~/Maildir is not the default 
directory for mail in a users $HOME, ~/Mail is. I think this might be the 
reason you're not seeing the contents of ~/Maildir when you use 'c' and '?' - 
make sure $folder is set in muttrc.

Now, if you wish to set up more Maildirs in ~/Maildir, e.g. for sent you can 
use mkdir(1) to make these quite easily. You have quite a lot of mail folders, 
you may wish to stick to the naming convention you've applied or you could 
chose something new, and perhaps more simple. Just one final example for you, 
if you were to create the sent Maildir ~/Maildir/OUTBOX/2012/outbox-09-12, 
you'd simply do this:

        mkdir -p ~/Maildir/OUTBOX/2012/outbox-09-12/{cur,new,tmp}

I hope that makes it clearer for you. 

BTW, as you're using procmail, procmail will create Maildirs for you. But I 
would get your Maildirs set up properly first, at least the top level 
directories so procmail has a proper directory layout to work from. It only 
creates the {cur,new,tmp} bit, it won't create new directories.

Once you've done this, open mutt; use 'c' and '?' to navigate to your saved 
Maildir in your $HOME, then just go into each mail folder, tag all of them and 
save them to the new location at ~/Maildir/.../.../whatever. Ideally of course, 
you would have made a backup of the original mbox mailboxes you had before you 
attempted any of this. If that is the case, use that instead to copy the mail 
over to the new ~/Maildir.

You should be ok from there on. Bear in mind this my own approach, there may be 
better options and plenty of people on this list will no doubt have better 
suggestions. Hopefully they'll have time to improve mine for you or come up 
with something totally different and more efficient.

This sort of thing is easily achieved in a shell script, if your shell 
scripting knowledge is ok.

Best wishes, Jamie 

Reply via email to