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

Re: To mbox or not, that is the question! (fwd)



On Tue, Apr 27, 2004 at 10:18:31PM -0400, Mike M wrote:
| On Tue, Apr 27, 2004 at 11:55:01AM -0400, Derrick 'dman' Hudson wrote:
| 
| > Use ssh (openssh or putty) and run mutt in the terminal when you are
| > remote.  The only trick is to understand where kmail puts the folders
| > so that you can tell mutt to look there.  mutt itself doesn't really
| > care, and is so configurable that you can make it do almost anything.
| > 
| > One example (option) :
| >     $ cd ~/Mail
| >     $ mutt -f .the-name-of-the.mail-subfolder
| 
| not so good if you have lots of folders or deeply nested folders.

tab-complete.  Who really types all of that out manually anyways?  :-)

| > See how mutt really doesn't care where the folder is or what it is
| > named, as long as it is a valid mbox, maildir, mh or
| > something-else-I-forgot mail spool?
| > 
| > Another option :
| >     Read 'man muttrc' and then edit your ~/.muttrc so that mutt
| >     doesn't hide hidden files.  Then the visual navigation in mutt
| >     will display the folders where kmail "hides" them.  (I'm sure its
| >     possible but I don't know the exact parameter offhand)
| 
| This looks interesting. I searched "man mutt" and the Mutt Manual for
| "hidden" and could not find the control you refer to.  Maybe I missed
| it, or misunderstood it.

Actually, I didn't find it at first either, but then I ran mutt and
typed 'c?' and noticed the text "File Mask: !^\.[^.]" in the status
line.

| > Another option is to use mutt's 'mailboxes' directive to explicitly
| > tell mutt about all your mailboxes.  Then run 'mutt -y' and select a
| > mailbox to open.
| 
| Very tedious if the kmail folder system is large (as mine was).

Unix is powerful.  Some ways of handling this scenario :

    .   in your .muttrc, put
            mailboxes `echo ~/Mail/.[^.]*`
        This means that all new mailboxes are automatically recognized
        by mutt as a mailbox that can receive new mail.


    .   $ cd ~/Mail ; for F in .[^.]* ; do echo 'mailboxes =$F' >> ~/.muttrc ; done

            This uses the shell to append a line in your .muttrc for
            each mailbox.  The list of mailboxes is static in this
            case, but you can tweak it with $EDITOR after the initial
            list is made.


    .   $ vim .muttrc
        [now in vim]
        :r!ls ~/Mail/.[^.]*
        [highlight the area with the list of filenames using visual mode]
        :'<,'>s/^/mailboxes /
        :wq

            This achieves the same result as the shell example above,
            but using my preferred editor.
        
| I've gone through the kmail system of mboxes, changing the .names to
| "names_sans_leadingdot".

Did you do that manually in konqueror?  That's quite tedious too :-).

    $ cd ~/Mail
    $ for F in .[^.]* ; do mv $F `echo $F | sed 's/^\.//'` ; done


To summarize, tedious tasks like this are made quick and easy by
leveraging and combining some of the various tools Unix provide.  A
little time spent sooner to learn the tools will result in a lot of
time saved later.  Don't be daunted, though, because it takes years
for people (including myself) to accumulate such a large toolbox.  The
toolbox doesn't stop growing, either.

-D

PS  I use the pattern .[^.]* fairly often in the shell.  Don't use .*
    because that will include '.' and '..' in the expansion, and you
    usually don't want that.

-- 
What good is it for a man to gain the whole world, yet forfeit his
soul?  Or what can a man give in exchange for his soul?
        Mark 8:36-37
 
www: http://dman13.dyndns.org/~dman/            jabber: dman@dman13.dyndns.org

Attachment: signature.asc
Description: Digital signature


Reply to: