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

Re: procmail with mutt



* On 2006.01.17, in 
<5d1a32000601170622p7287e819ge3bc491a4ee0d5a7@xxxxxxxxxxxxxx>,
*    "Gerald Britton" <gerald.britton@xxxxxxxxx> wrote:
> 
> "An MH folder is a directory containing either a .mh_sequences or
> .xmhcache file. Messages are separate files that are numbered
> sequentially. MH is rarely used, most prefer the maildir format."

Good, you do need this.


> Now, mutt starts without errors, but does not display the messages
> that are there.  I suppose it is looking for files with a particular
> naming convention.  Does anyone know what that is?

MH folders number their messages sequentially and numerically.  For example:

unix$ ls -lA Mail/mh/osg/sshafs
total 244
-rw-r--r--   1 dgc      dgc            8 Jun  8  2000 .mh_sequences
-rw-r--r--   1 dgc      dgc         1100 Jun  8  2000 .xmhcache
-rw-------   1 dgc      dgc         2541 Feb 28  1996 1
-rw-------   1 dgc      dgc         4980 Mar  4  1996 10
-rw-------   1 dgc      dgc        85625 Apr 25  1996 11
-rw-------   1 dgc      dgc         1246 Feb 28  1996 2
-rw-------   1 dgc      dgc         5283 Mar  1  1996 3
-rw-------   1 dgc      dgc         2884 Mar  1  1996 4
-rw-------   1 dgc      dgc         3673 Mar  1  1996 5
-rw-------   1 dgc      dgc         3502 Mar  1  1996 6
-rw-------   1 dgc      dgc         1624 Mar  1  1996 7
-rw-------   1 dgc      dgc         2243 Mar  1  1996 8
-rw-------   1 dgc      dgc         2065 Mar  4  1996 9


I don't know how you got your msg.XXXX files; when I file a message via
procmail:
    :0
    mhfolder/.

I get numeric filenames, as they should be.


You could fix the MH folder by renaming all those messages, or you could
convert them to Maildir.

* Fixing the MH folder
    unix$ cd FOLDERNAME
    unix$ perl -e 'opendir(D, "."); \
               $n = 1; \
               for $file (grep /^msg/, readdir(D)) { \
                   rename $file $n; \
                   $n++; \
               }'

* Converting to Maildir
    unix$ cd FOLDERNAME
    unix$ mkdir new cur tmp
    unix$ mv msg.???? cur

Of course, if you remain with MH, you need to be certain that procmail
is filing them correctly in the future -- that is, numerically instead
of with msg.XXXX names.

This is untested, so it's perhaps best to try it in a work folder first.

-- 
 -D.    dgc@xxxxxxxxxxxx        NSIT    University of Chicago